mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 20:23:11 +03:00
Js shebang (#2830)
* add shebang to outputted node file after `chmod`ing the file, it can be run directly ie `./build/exec/test` rather than `node ./build/exec/test`` * update CHANGELOG.md * [ linter ] * [ linter ] again...
This commit is contained in:
parent
45fc038300
commit
217271a623
@ -27,6 +27,10 @@
|
||||
* Non-recursive top-level constants are compiled to eagerly evaluated
|
||||
constants in Chez Scheme.
|
||||
|
||||
#### Node.js
|
||||
|
||||
* Generated JavaScript files now include a shebang when using the Node.js backend
|
||||
|
||||
### Compiler changes
|
||||
|
||||
* If `IAlternative` expression with `FirstSuccess` rule fails to typecheck,
|
||||
|
@ -31,7 +31,12 @@ compileToNode :
|
||||
Ref Ctxt Defs ->
|
||||
Ref Syn SyntaxInfo ->
|
||||
ClosedTerm -> Core String
|
||||
compileToNode c s tm = compileToES c s Node tm ["node", "javascript"]
|
||||
compileToNode c s tm = do
|
||||
js <- compileToES c s Node tm ["node", "javascript"]
|
||||
pure $ shebang ++ js
|
||||
where
|
||||
shebang : String
|
||||
shebang = "#!/usr/bin/env node\n"
|
||||
|
||||
||| Node implementation of the `compileExpr` interface.
|
||||
compileExpr :
|
||||
|
Loading…
Reference in New Issue
Block a user