Migrate nlTokBuilder + nlTokStream -> nlLexer
This commit is contained in:
parent
07a9bda9ba
commit
d7fb1f0c89
2 changed files with 90 additions and 54 deletions
12
src/nlx.nim
12
src/nlx.nim
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue