Skip to content

Commit

Permalink
pEchoCommand handle infix expressions
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Feb 28, 2024
1 parent 00d2641 commit 7ab5e47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tim/engine/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,13 @@ prefixHandle pEchoCommand:
varNode = p.getPrefixOrInfix()
else:
varNode = p.pIdent()
if p.curr.isInfix and p.curr.line == p.prev.line:
# todo move line checker to `isInfix`
varNode = p.parseInfix(varNode)
else:
varNode = p.getPrefixOrInfix()
return ast.newCommand(cmdEcho, varNode, tk)
caseNotNil varNode:
return ast.newCommand(cmdEcho, varNode, tk)
else: errorWithArgs(unexpectedToken, p.curr, [p.curr.value])

prefixHandle pReturnCommand:
Expand Down

0 comments on commit 7ab5e47

Please sign in to comment.