Skip to content

Commit

Permalink
update parser
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Mar 4, 2024
1 parent 61490c5 commit 4311d8b
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions src/tim/engine/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -287,30 +287,31 @@ prefixHandle pIdent:
result = ast.newIdent(p.curr)
let storageType = p.getStorageType()
walk p
case p.curr.kind
of tkDot:
# handle dot expressions
result = p.parseDotExpr(result)
caseNotNil result:
case result.nt
of ntDotExpr:
result.storageType = storageType
of ntBracketExpr:
result.bracketStorageType = storageType
else: discard
of tkLB:
# handle bracket expressions
result = p.parseBracketExpr(result)
caseNotNil result:
case result.nt
of ntDotExpr:
result.storageType = storageType
of ntBracketExpr:
result.bracketStorageType = storageType
else: discard
if p.curr is tkDot and p.curr.line == result.meta[0]:
if p.curr.line == result.meta[0]:
case p.curr.kind
of tkDot:
# handle dot expressions
result = p.parseDotExpr(result)
else: discard
caseNotNil result:
case result.nt
of ntDotExpr:
result.storageType = storageType
of ntBracketExpr:
result.bracketStorageType = storageType
else: discard
of tkLB:
# handle bracket expressions
result = p.parseBracketExpr(result)
caseNotNil result:
case result.nt
of ntDotExpr:
result.storageType = storageType
of ntBracketExpr:
result.bracketStorageType = storageType
else: discard
if p.curr is tkDot and p.curr.line == result.meta[0]:
result = p.parseDotExpr(result)
else: discard

prefixHandle pIdentOrAssignment:
let ident = p.curr
Expand Down

0 comments on commit 4311d8b

Please sign in to comment.