v3 Parsing: calls, indexing, literals
Expression architecture
- Expression starts at equality and descends through comparison -> term -> factor -> unary -> postfix.
- This keeps precedence simple and predictable.
Postfix chaining
postfix -> primary (call | index)*
- left-to-right chaining
- each
()becomesExprCall - each
[]becomesExprIndex
Function declarations as statements
fncan appear in block contexts.- nested function parsing is just recursive parse of nested statements.
Literal parsing
arrayandmapare primaries.- empty literals are legal:
[],{}. - map requires colon between key and value.
L-value checks
- assignments use parse-time target validation:
- allowed: identifier or index expression
- rejected: call/member/complex ops on LHS
Practice focus
- nested call + index chains
- map delimiter errors
- block/literal boundary understanding
- return with and without expression
1 / 1