remove a Text.Parser dependency (about 10%), and alternate tokenizer

This commit is contained in:
2024-12-28 21:49:49 -08:00
parent 23a95f70f5
commit 9a2eac0bd7
6 changed files with 115 additions and 16 deletions

View File

@@ -18,7 +18,7 @@ import Lib.Parser.Impl
import Lib.Prettier
import Lib.ProcessDecl
import Lib.Token
import Lib.Tokenizer
import Lib.Tokenizer2
import Lib.TopContext
import Lib.Types
import Lib.Syntax
@@ -152,10 +152,11 @@ processModule importFC base stk name = do
processFile : String -> M ()
processFile fn = do
putStrLn "*** Process \{fn}"
let parts = splitPath fn
let file = fromMaybe "" $ last' parts
let dir = fromMaybe "./" $ parent fn
let (name,ext) = splitFileName (fromMaybe "" $ last' parts)
let parts = split (== '/') fn
let file = last parts
let dirs = init parts
let dir = if dirs == Nil then "." else joinBy "/" dirs
let (name,ext) = splitFileName file
putStrLn "\{show dir} \{show name} \{show ext}"
-- declare internal primitives