diff --git a/src/noether.nim b/src/noether.nim index 509b123..83c2b1b 100644 --- a/src/noether.nim +++ b/src/noether.nim @@ -2,4 +2,4 @@ # uses this file as the main entry point of the application. when isMainModule: - echo "Noether Lang" + echo "Noether Lang v0.1.0" diff --git a/src/noether/parser/nodes.nim b/src/noether/parser/nodes.nim index a50eee0..bd737c6 100644 --- a/src/noether/parser/nodes.nim +++ b/src/noether/parser/nodes.nim @@ -42,6 +42,4 @@ proc newBiNode*(nKind: nlNodeKind): nlNode = # Short-hand way of appending a token to a node's token sequence proc addTok*(node: nlNode, tok: nlTok) = - echo node[] - echo node.toks node.toks.add(tok) diff --git a/src/noether/parser/parser.nim b/src/noether/parser/parser.nim index 4654fb3..dcdcc06 100644 --- a/src/noether/parser/parser.nim +++ b/src/noether/parser/parser.nim @@ -24,28 +24,31 @@ proc parseStmt(parser: var nlParser): nlParseStat = # initialise build node as none just for the hell of it while parser.stream.progress(): - echo parser.stream.currTok + echo "Current Token: ", parser.stream.currTok case parser.stream.currTok.tKind of tkDQUO: # Attempt to parse string literal if parser.parseStrLit() != nlParseStat.OK: echo "Unmatched Double Quotation! Malformed String Literal" echo parser.stream.line - echo repeat(" ", parser.stream.currTok.startPos), '^' + echo repeat(" ", parser.stream.currTok.startPos), '^', '\n' else: echo "Parsed String Literal" - echo parser.bnode[] + echo parser.bnode[], '\n' of tkSQUO: # Attempt to parse string literal if parser.parseChrLit() != nlParseStat.OK: echo "Unmatched Single Quotation! Malformed Character Literal" echo parser.stream.line - echo repeat(" ", parser.stream.currTok.startPos), '^' + echo repeat(" ", parser.stream.currTok.startPos), '^', '\n' else: echo "Parsed Character Literal" - echo parser.bnode[] + echo parser.bnode[], '\n' + of tkEOL: + # TODO: handle this case, don't just discard + discard else: - echo "blah blah unhandled case" + echo "blah blah unhandled case\n" result = nlParseStat.OK # Attempt to parse nlAST from nlTokStream