Merge pull request #436 from edwinb/update-js

Update JS code generator to remove RF
This commit is contained in:
Niklas Larsson 2020-07-09 00:03:51 +02:00 committed by GitHub
commit b955d2e50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,7 @@ Compiler changes:
* It is now possible to create new backends with minimal overhead. `Idris.Driver`
exposes the function `mainWithCodegens` that takes a list of codegens. The
feature in documented [here](https://idris2.readthedocs.io/en/latest/backends/custom.html).
* New code generators `node` and `js`.
REPL changes:

View File

@ -60,4 +60,5 @@ or via the `IDRIS2_CG` environment variable.
chez
racket
gambit
javascript
custom

View File

@ -0,0 +1,5 @@
***********************************
Javascript and Node Code Generators
***********************************
To be added.

View File

@ -84,7 +84,6 @@ jsName (UN n) = keywordSafe $ jsIdent n
jsName (MN n i) = jsIdent n ++ "_" ++ show i
jsName (PV n d) = "pat__" ++ jsName n
jsName (DN _ n) = jsName n
jsName (RF n) = "rf__" ++ jsIdent n
jsName (Nested (i, x) n) = "n__" ++ show i ++ "_" ++ show x ++ "_" ++ jsName n
jsName (CaseBlock x y) = "case__" ++ jsIdent x ++ "_" ++ show y
jsName (WithBlock x y) = "with__" ++ jsIdent x ++ "_" ++ show y