Commit Graph

3315 Commits

Author SHA1 Message Date
Georges Dupéron
ea358f7101 Removed manual copy of ligo-parser prior to merging Christian's history 2019-03-27 11:13:15 +01:00
Galfour
89a7821e87 Merge branch 'master' of gitlab.com:gabriel.alfour/tezos 2019-03-27 06:30:14 +00:00
Galfour
7716f78139 more tests 2019-03-27 06:30:05 +00:00
Christian Rinderknecht
e4eaad5385
Refactoring of AST and parser (type [map_injection] removed). 2019-03-26 23:36:41 +01:00
Christian Rinderknecht
b200239d82
Refactoring of the parser specification.
The rules [set_injection] and [list_injection] have been unified
in a new parametric rule [injection(Kind)].

The rules [unqualified(OP)] and [extended_expr] were refactored too.
2019-03-26 20:33:13 +01:00
Christian Rinderknecht
45a26826ca
Maps and sets defined by extension are now general expressions.
They used to be allowed only as initial values in declarations.
This new syntax enables idioms like

if set ["John"; "Paul"] contains x then ... else
2019-03-26 19:27:24 +01:00
Christian Rinderknecht
f9ffc7b8e7
List elements are now consistently separated by semicolons. 2019-03-26 17:25:42 +01:00
Christian Rinderknecht
4476a2faba
Selections can be done now through tuples.
New syntax: a.2.b.4.2.x
where the numerals denote the component of a tuple.
2019-03-26 17:12:22 +01:00
Georges Dupéron
e342c278d7 Some typer tests for expressions 2019-03-26 16:20:40 +01:00
Christian Rinderknecht
847a3a42b6
Refactoring for tuple expressions. 2019-03-26 15:51:28 +01:00
Christian Rinderknecht
c0800a64ef
Set membership is now a full-fledged expression.
It used to be tied to the test expression of a conditional.
2019-03-26 12:00:09 +01:00
Galfour
5507482b2d test for condition 2019-03-26 09:59:20 +00:00
Christian Rinderknecht
fef4337e83
Support for empty sets and maps. Alternate syntax for maps and lists:
sets, maps and lists are now homogeneous.

Lists by extension now require the "list" keyword, like sets and
maps. Semicolons needed, instead of commas.

New syntax for lists: `list [e_1; e_2; ...; e_n]`.

The empty list can now be denoted either by `list []` or `list end` or
`nil'.

Both `list` and `nil` are new keywords. Lists can also be denoted
without brackets, as sets and maps: `list e_1; e_2; ...; e_n end`.

The extension for maps follows the extension for sets: `map [b_1; b_2;
...; b_n]` or `maps b_1; ...; b_n end`.
2019-03-26 10:31:55 +01:00
Galfour
1fe74323be more tests 2019-03-26 08:36:22 +00:00
Galfour
043387ec14 better test 2019-03-26 07:28:01 +00:00
Galfour
10bcecc490 basic top level 2019-03-25 20:52:09 +00:00
Christian Rinderknecht
98f9d3e417
Extended conditional syntax for "else" clauses.
New syntax: if ... then ... else { ... }
2019-03-25 17:25:10 +01:00
Georges Dupéron
984fa24ca6 Installation seems to work using README_INSTALL 2019-03-25 17:16:46 +01:00
Christian Rinderknecht
aced77e085
Added alternate syntax for conditionals in "then" clauses.
New syntax: if ... then { ... } else ...
2019-03-25 17:14:35 +01:00
Christian Rinderknecht
457a0085f7
I added and alternate syntax for blocks of instructions.
The syntax: block { ... }
The other syntax: begin ... end
This implies adding a new keyword to LIGO: "block".
2019-03-25 16:38:07 +01:00
Georges Dupéron
1ec945fa4b Installation commands (temporary) 2019-03-25 14:38:06 +01:00
Georges Dupéron
afca07d888 This version of OCaml (4.06.1 with dune/opam) seems to not like shadowing vs. open
The shadowing worked fine with a standalone ocaml 4.07.1 (no dune or opam use)
2019-03-25 14:38:06 +01:00
Georges Dupéron
3cb9a311ee Disable git commit in Version.ml for now
It does not work well with opam install, especially if the dune file is not at the root of the repository.
2019-03-25 14:38:06 +01:00
Georges Dupéron
f614c692d1 Initial import of Rope library 2019-03-25 14:38:06 +01:00
Galfour
f08b0e155b fixed tezos-utils.opam 2019-03-25 07:48:43 +00:00
Galfour
7ba31d4d7d introspection 2019-03-24 18:53:20 +00:00
Galfour
47c8e96e95 more basic structure 2019-03-24 17:35:43 +00:00
Galfour
ccd4a17aac pipeline works 2019-03-23 13:47:18 +00:00
Galfour
ecefa598f7 ez run main 2019-03-23 12:48:20 +00:00
Galfour
9adbbb34bc pipeline ok 2019-03-23 10:52:25 +00:00
Galfour
0ffd3d4b64 tmp 2019-03-22 20:08:37 +00:00
Christian Rinderknecht
ea4af374f9
Removed braces from the lexer and parser. 2019-03-22 14:11:32 +01:00
Christian Rinderknecht
ad6cbf32eb
I added support for set membership.
Syntax: if s contains e then ... else
(only as a test expression in conditionals).
2019-03-21 23:45:19 +01:00
Christian Rinderknecht
19f6981ae7
I added an optional semi-colon before "else".
Syntax: if ... then ...; else ...
2019-03-21 23:18:09 +01:00
Christian Rinderknecht
c76ec00c9b
I added the patching of sets.
Syntax: patch s with set ... end
2019-03-21 23:12:46 +01:00
Christian Rinderknecht
98590b2e4a
Added support for removal from sets.
Syntax: remove e from set s
2019-03-21 23:01:21 +01:00
Christian Rinderknecht
f6dbd9d601
I added set definitions by extension.
For example:

const bar : set (int) = set 1; 1+1; f(3); end
2019-03-21 22:55:08 +01:00
Galfour
66974949b2 first working example of the whole pipeline 2019-03-21 21:37:44 +00:00
Christian Rinderknecht
1e65c63d99
Added construct remove k from map m. 2019-03-21 21:55:59 +01:00
Christian Rinderknecht
285be32729
I added an optional semi-colon in record type declarations. 2019-03-21 21:34:22 +01:00
Galfour
0975f71059 tmp 2019-03-21 14:53:09 +00:00
Christian Rinderknecht
fa8adb9bde
Restricted types of parameters to cartesian types. 2019-03-21 15:09:35 +01:00
Christian Rinderknecht
3b318d0f06
Renamings. 2019-03-21 12:55:24 +01:00
Galfour
8819422542 pre big modif 2019-03-20 22:04:39 +00:00
Christian Rinderknecht
abbebbf0f6
Refactoring of the AST. 2019-03-20 21:36:12 +01:00
Galfour
d23c49920c tmp 2019-03-20 17:25:32 +00:00
Galfour
a9f88e3ddf tmp 2019-03-20 17:06:12 +00:00
Christian Rinderknecht
aa117ecfc2
I removed dummy module [MBytes] an use [Hex] directly. 2019-03-20 17:48:57 +01:00
Christian Rinderknecht
495686bbd4
I extended the right-hand side of assignments to accept "None"
without type annotation.

This is meant to enable specify the removal of a map binding.

Note: The index assignments in loops are not concerned.
2019-03-20 16:19:33 +01:00
Galfour
1918bc00d1 tmp 2019-03-20 14:54:30 +00:00