Work on usable codegen

- escape js names
- executable output
- better FC in parsing
- experiment with IO
This commit is contained in:
2024-09-29 22:17:51 -07:00
parent 76e627825c
commit 151f678f75
7 changed files with 116 additions and 18 deletions

View File

@@ -46,8 +46,10 @@ dumpSource = do
writeSource : String -> M ()
writeSource fn = do
doc <- compile
Right _ <- writeFile fn $ render 90 doc
let src = "#!/usr/bin/env node\n" ++ render 90 doc ++ "\nmain();"
Right _ <- writeFile fn src
| Left err => fail (show err)
Right _ <- chmodRaw fn 493 | Left err => fail (show err)
pure ()
parseFile : String -> M (String,Module)