Add support for JsLIGO (experimental)
Things to do for the JsLIGO parser (among others):
-
decompiler -
add support for attributes (via comments or another way?) -
fix incorrect array destructuring -
fix pretty printing -
documentation -
polymorphic + (typer) -
fix shift/reduce challenge when supporting variant with a leading |
, -
fix shift/reduce challenge between bin_op(..., "<", ...)
and type arguments (foo<bar>
) -
add support for code injection syntax that's compatible with TypeScript syntax -
first support verbatim strings with back ticks eg. template literals.
-
-
fix shift/reduce challenge when parentheses for: "(" cartesian "=>" fun_type ")"
-
properly separate lowercase + uppercase names as in other syntaxes -
support arrow function with ()
as arguments -
add support for foo = bar;
(assignment to existing variable) -
fix function type arguments, requires a argument name like: type z = (a: int) => string
-
support 'foo' next to "foo" for strings -
be more compliant when using {...}
and({...})
-
support _
as variable name (mostly works, needs to be properly checked) -
make semicolons optional -
change sum type examples to:
type foobar =
| ['foo' , int]
| ['bar' , int]
-
fix type f = (x : int) => int
Nice to haves:
-
make leading |
in sum type optional -
remove necessary parentheses in (foo as x)
at some point, not a blocker
Later:
-
can we improve on the constructor syntax? -
make sure variable names can't be reused in the same block (ast_core) -
for-of with maps support (typer) -
export support (typer) -
constant variables support (typer)
Choices made in current implementation of the JsLIGO parser:
- pattern matching will be done via a "built-in" match function (probably implemented in the abstractor)
- "%" is used as a modulo operator, which is not correct as JS uses it for a remainder operation but close enough.
- expressions are used for function arguments as per EcmaScript specification
closes #1051 (closed) #1051 (closed)