From 4311d8bb9d51880054e8fa44b6539d1a45ac8d09 Mon Sep 17 00:00:00 2001 From: George Lemon Date: Mon, 4 Mar 2024 21:01:34 +0200 Subject: [PATCH] update parser Signed-off-by: George Lemon --- src/tim/engine/parser.nim | 47 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/tim/engine/parser.nim b/src/tim/engine/parser.nim index 0062b37..adc8492 100755 --- a/src/tim/engine/parser.nim +++ b/src/tim/engine/parser.nim @@ -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