Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 1.47 KB

nuon.md

File metadata and controls

40 lines (23 loc) · 1.47 KB

How parsing Nuon works

[[name, age]; [rick 24] [hb 34]]

Reference

[[name, age]; [rick 23] [bill 34]]
Why does an empty return in repl trigger parse_math_expression to get called four (4) times ?

The behavior actually happened before repl, nushell add menus to line_editor, in nu-cli/src/reedline_config:add_menus function, there are 4 default menus to add, each menu triggers one parse_math_expression call.


Why does this nuon code get parsed in parse_math_expression ?

It's because it's a math expression, in is_math_expression_like function, it returns true if the input starts with [

I think it's because in nushell, many things are semantic mathematical expressions.

Obvious example: 3 + 4 is a math expression. Not obvious example: the number 3 itself is also a math expression, it's just an expression with no rhs.


And then after the table gets displayed I see the parse_math_expression get called the four (4) times as noted above

After table gets displayed, a new loop_iteration begins. So 4 default menus are parsed, evaluated, and added.