Skip to content

Commit

Permalink
feat: [parser] name tokens are parsed as get exprs
Browse files Browse the repository at this point in the history
  • Loading branch information
ngjunsiang committed Apr 15, 2022
1 parent 737a3e4 commit 26a13ac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from builtin import ParseError
from builtin import ParseError, get
from scanner import makeToken


Expand Down Expand Up @@ -49,7 +49,10 @@ def value(tokens):
consume(tokens) # )
return expr
elif token['type'] == 'name':
return consume(tokens)
frame = None
name = identifier(tokens)
oper = {'type': 'symbol', 'word': '', 'value': get}
return makeExpr(frame, oper, name)
else:
raise ParseError(f"Unexpected token {repr(token['word'])}")

Expand Down

0 comments on commit 26a13ac

Please sign in to comment.