Commit Graph

3982 Commits

Author SHA1 Message Date
Christian Rinderknecht
fe90246e3a Fixed the printing of some AST nodes. 2019-11-06 17:23:49 +01:00
Christian Rinderknecht
bd6ce2f28c Bug fix: Some nodes were not indented. 2019-11-05 15:57:43 +01:00
Christian Rinderknecht
351025b52d Refactoring of Ligodity (CameLIGO) and making an AST pretty-printer
- AST.ml/AST.mli:
  - The AST now distinguishes the constructors `None` and `Some` as being
    predefined, as in PascaLIGO. See type `AST.constr_pattern`.
  - I removed the nodes specific to Liquidity,
    e.g. `let%entry`, and, in particular, the natural literals
    ending with `p`. Now it should be `n`, as in `10n`.
  - I renamed the node `TAlias` to `TVar`.
  - I have applied the rule of expanding type expressions after `of` when
    those were not records.
  - The type of the argument to a data constructor is now
    `type_expr`, instead of `cartesian`.
  - I added the patterns for bytes (`PBytes`) and natural literals (`PNat`).
  - I renamed the node `Sugar` into
    `PListComp` (meaning "pattern of list comprehension").
  - Record types in CameLIGO now must have at least one field declaration.
  - Replaced the type `closing` and `opening` with one type `compound`,
    which captures only the right combinations of opening and closing.
  - Components of tuples in a selection must not be written
    between parentheses. For example, `a.b.(1).(0)` is now
    `a.b.1.0`, as in PascaLIGO.
- LexToken.mli/LexToken.mll
  - I renamed the string literal `Str` into `String`.
  - I added the tokens `C_None` and `C_Some` (to distinguish the
    constructors `None` and `Some`. See AST.ml)
  - Fixed the function `mk_sym` so it does not fail with `failwith`, but
    with `Error Invalid_symbol`.
- Lexer.mll (shared)
  - I removed the character `%` from the identifiers (used to
    support Liquidity, like `entry%point` and `match%nat`).
  - I adde to the hint on broken strings: "or insert a backslash"
    (from a Gitlab issue).
- ParToken.mly
  - I added the tokens `C_None` and `C_Some` (to distinguish the
    constructors `None` and `Some`. See AST.ml and LexToken.mll)
- Parser.mly
  - Fixed the order of declarations in the AST (it was reversed).
  - I removed syntax support for Liquidity.
  - I added user-defined constructor applications to irrefutable
    patterns (the ones afer a `let`), even though only the type
    checker can decide that they are truly irrefutable because they
    are the only constructors of their types.
  - I added natural numbers and bytes to patterns.
  - Access of tuple components do not require parentheses now, like
    `a.b.1.0`.
  - I refactored the semantic actions.
  - I added the empty sequence `begin end`.
- ParserLog.ml/ParserLog.mli
  - I added a pretty-printer for the AST (with source locations).
- ParserMain.ml
  - The CLI for the pretty-printer is now `--verbose=ast`.
  - The old CLI `--verbose=ast` is now `--verbose=ast-tokens`.
- ligodity.ml (simplifier)
  - I removed the constructions of sets, lists and maps with
    `Set [...]`, `List [...]` and `Map [...]`, as there are already
    better ways (that is, more like the OCaml's way), like
    `Set.literal [...]` and `Map.literal [...]`. (The case for lists
    was entirely redundant with the rest of the language as it is.)
  - Everywhere there is now a non-empty list of elements, I made a
    change. In particular, I removed a corner case ("let without
    binding"), thanks to more precise OCaml types for non-empty
    lists.
  - I ported all the changes to the AST above.
- region.ml (vendors)
  - I changed the method `compact` so the end-line is not repeated
    if it is the same as the start line: this is even more compact. I
    use this in the new pretty-printer for the AST (see above)
- I updated all the CameLIGO contracts.
2019-11-04 23:51:47 +01:00
Gabriel Alfour
9efb837dd5 Merge branch 'feature/cameligo-while-loop' into 'dev'
[LIGO-168] Add the while loop to CameLIGO

See merge request ligolang/ligo!149
2019-11-04 19:06:18 +00:00
John David Pressman
aec572fc20 [LIGO-168] Add the while loop to CameLIGO 2019-11-04 19:06:18 +00:00
Gabriel Alfour
5e44be6baa Merge branch 'feature/elim-dead-lambdas' into 'dev'
Eliminate dead lambdas

See merge request ligolang/ligo!167
2019-11-04 15:49:45 +00:00
Tom Jack
c969f306af Eliminate dead lambdas 2019-11-02 18:43:46 -05:00
Tom Jack
e30b7faa9d Mini_c: Remove T_deep_closure and D_function 2019-11-02 18:43:46 -05:00
Tom Jack
cccbd424a8 Implement Mini_c.Free_variables 2019-11-02 18:43:46 -05:00
Tom Jack
a31d90bdfe Merge branch 'tezos-upgrade' into 'dev'
Prepare for tezos upgrade

See merge request ligolang/ligo!168
2019-11-02 23:41:13 +00:00
Tom Jack
ba7a83d0f7 Deal with upstream MBytes changes 2019-11-02 17:54:33 -05:00
Tom Jack
b06f4d3f62 Delete protocol tests 2019-11-02 17:54:21 -05:00
Tom Jack
f739624185 Prepare for tezos upgrade 2019-11-02 17:38:39 -05:00
Gabriel Alfour
2bace61ea8 Merge branch 'feature/byte_pack' into 'dev'
add bytes_pack

See merge request ligolang/ligo!165
2019-10-31 17:34:48 +00:00
Lesenechal Remi
b9d32ddf4e add bytes_pack 2019-10-31 17:39:07 +01:00
Rémi Lesenechal
0423a704ec Merge branch 'feature/signature_type' into 'dev'
add signature type

See merge request ligolang/ligo!164
2019-10-31 16:36:23 +00:00
Lesenechal Remi
f341527aa6 add signature type 2019-10-31 16:46:07 +01:00
Tom Jack
58638c6a05 Merge branch 'feature/hex' into 'dev'
Add hex michelson output, use enums for format options

See merge request ligolang/ligo!162
2019-10-31 15:39:03 +00:00
Tom Jack
76ecd56e3d Merge branch 'feature/babylon-optimizer' into 'dev'
Update optimizer for Babylon

See merge request ligolang/ligo!158
2019-10-31 15:17:00 +00:00
Tom Jack
fd03d577e4 Support --michelson-format in all commands producing Michelson 2019-10-31 09:50:51 -05:00
John David Pressman
e34af5bd7b Merge branch 'test/cameligo-test-parity' into 'dev'
[LIGO-171] Bring CameLIGO up to test parity with PascaLIGO

See merge request ligolang/ligo!151
2019-10-30 15:24:14 +00:00
John David Pressman
750605cee4 Merge branch 'dev' of gitlab.com:ligolang/ligo into test/cameligo-test-parity 2019-10-29 22:06:42 -07:00
John David Pressman
27b7527f18 Add test for CameLIGO set fold 2019-10-29 21:33:48 -07:00
John David Pressman
85345387d0 Add tuple tests to CameLIGO 2019-10-29 20:55:36 -07:00
John David Pressman
2ff178543f Add more operations to CameLIGO set tests 2019-10-29 20:33:18 -07:00
John David Pressman
c09116211f Merge branch 'feature/cameligo-negative-op' into 'dev'
[LIGO-172] Add negative operator to CameLIGO

See merge request ligolang/ligo!161
2019-10-29 18:12:17 +00:00
Christian Rinderknecht
b382626145 Merge branch 'feature/unsupported-for-loops' into 'dev'
pascaligo.ml: unsupported_for_loops

See merge request ligolang/ligo!132
2019-10-29 17:48:21 +00:00
John David Pressman
f0f4c683f2 Add more complex negative operator test 2019-10-29 10:07:07 -07:00
John David Pressman
dce98c06ec Merge branch 'dev' of gitlab.com:ligolang/ligo into feature/cameligo-negative-op 2019-10-29 09:59:37 -07:00
John David Pressman
102ffda7c3 Make negative operator test pass 2019-10-29 09:28:20 -07:00
Lesenechal Remi
a140e12394 add test for nested for collection loops (not supported yet) 2019-10-29 16:32:28 +01:00
Lesenechal Remi
402d849cec use intermediary tuple access to get key and value for maps. add tests. 2019-10-29 15:43:00 +01:00
Lesenechal Remi
fd901548af add more tests 2019-10-29 11:57:15 +01:00
Lesenechal Remi
c288f3c81e simplify the simplifier and now find the free variables with a expression_fold 2019-10-29 11:56:21 +01:00
Lesenechal Remi
e86c92bc3b improving simplifier 2019-10-29 11:41:59 +01:00
Lesenechal Remi
ba00db2b4c add self_ast_simplified fold_expression 2019-10-29 10:43:38 +01:00
John David Pressman
ec3f836605 Add test for several function parameters in CameLIGO 2019-10-28 22:07:00 -07:00
John David Pressman
c004fd24cd Add option and boolean match tests to CameLIGO 2019-10-28 22:01:31 -07:00
John David Pressman
f62481fb0a Add list match test to CameLIGO 2019-10-28 21:38:29 -07:00
Lesenechal Remi
e77f3e4903 empty for collection loop 2019-10-28 20:52:14 +01:00
Lesenechal Remi
37570c6a40 clean test 2019-10-28 20:52:14 +01:00
Lesenechal Remi
2ced2e784e add doc 2019-10-28 20:52:14 +01:00
Lesenechal Remi
e16eac77a6 fixes for loop on map.
Untested because of issue with deep tuple access (LIGO-131 LIGO-134)
An error message is in the simplifier
2019-10-28 20:52:14 +01:00
Lesenechal Remi
1a035f9713 tests for sets 2019-10-28 20:52:14 +01:00
Lesenechal Remi
b71309bfa2 proper error message for deep accesses in loops of collection body 2019-10-28 20:52:14 +01:00
Lesenechal Remi
c7056d200d merging with dev 2019-10-28 20:52:14 +01:00
Lesenechal Remi
5a77b08aa7 cleaning & documenting 2019-10-28 20:52:14 +01:00
Lesenechal Remi
7eed9b1856 test passing ! 2019-10-28 20:52:14 +01:00
Lesenechal Remi
a3deccf352 changing the name of the lambda to 'arguments' make its arguments available 2019-10-28 20:52:14 +01:00
Lesenechal Remi
164e88e818 remove shadowing of lambda name over the constant name 2019-10-28 20:52:14 +01:00