Migrate nlTokBuilder + nlTokStream -> nlLexer

This commit is contained in:
Emile Clark-Boman 2025-06-19 09:38:08 +10:00
parent 07a9bda9ba
commit d7fb1f0c89
2 changed files with 90 additions and 54 deletions

View file

@ -1,19 +1,19 @@
import os
import noether/lib/io
import noether/lexer/[tok, tokstream]
import noether/lexer/tokbuilder
# import noether/parser/parser
{.hint: "Don't forget to drink more water (^_^)".}
when isMainModule:
echo "Noether Lang Extras v0.1.0 - nlx"
var inStream = if paramCount() > 0: streamFile(paramStr 1)
else: streamString(readAll stdin)
var stream = if paramCount() > 0: streamFile(paramStr 1)
else: streamString(readAll stdin)
var stream = newTokStream(inStream)
var lexer = newLexer(stream)
# # DumpTok
while stream.progress():
echo stream.tok
while lexer.progress():
echo lexer.tok
# DumpTree
# discard parse(tokStream)