Begun parser design + typo fixes + improved lexer modularity

This commit is contained in:
Emile Clark-Boman 2025-06-18 13:35:07 +10:00
parent 90ca138904
commit a258802945
6 changed files with 103 additions and 31 deletions

View file

@ -1,6 +1,7 @@
import os
import noether/lexer/tok
import noether/lexer/tokstream
import noether/parser/parser
when isMainModule:
echo "Noether Lang Extras v0.1.0 - nlx"
@ -9,10 +10,13 @@ when isMainModule:
let filename = paramStr(1)
var tokStream = newTokStream(filename, isFile=true)
# DumpTok
var tok: nlTok
while tokStream.nextTok(tok):
echo tok
# # DumpTok
# var tok: nlTok
# while tokStream.nextTok(tok):
# echo tok
# DumpTree
discard parse(tokStream)
else:
echo "usage: nlx filename"