Closed ysangkok closed 1 year ago
you need to end all statements with ';'
this is not javascript ahahaha. 😅
plox> 1?2?3:4:5 ;
TOKENS
[NUMBER '1' `1.0`]
[QUESTION '?' `None`]
[NUMBER '2' `2.0`]
[QUESTION '?' `None`]
[NUMBER '3' `3.0`]
[COLON ':' `None`]
[NUMBER '4' `4.0`]
[COLON ':' `None`]
[NUMBER '5' `5.0`]
[SEMICOLON ';' `None`]
[EOF '' `None`]
STATEMENTS
StmtExpr(if [Literal(value=1.0)]; then [Ternary(comparison=Literal(value=2.0), left=Literal(value=3.0), right=Literal(value=4.0))]; else [Literal(value=5.0)])
INTERPRETATION
# 3.0
what I'm more interested on, is why the nested ternary 2?3:4
not getting printed 'nicely'...
Ah, cool, thanks!
applying the StrEnum fix i proposed in #1 , nested ternaries are not working: