diff --git a/compiler/heptagon/parsing/hept_lexer.mll b/compiler/heptagon/parsing/hept_lexer.mll index 3c8dd74..bc84b93 100644 --- a/compiler/heptagon/parsing/hept_lexer.mll +++ b/compiler/heptagon/parsing/hept_lexer.mll @@ -121,9 +121,9 @@ rule token = parse | [' ' '\t'] + { token lexbuf } | "." {DOT} | "(" {LPAREN} - | "((" {LPARENLPAREN} + | "(<" {LPAREN_LESS} | ")" {RPAREN} - | "))" {RPARENRPAREN} + | ">)" {GREATER_RPAREN} | "*" { STAR } | "{" {LBRACE} | "}" {RBRACE} diff --git a/compiler/heptagon/parsing/hept_parser.mly b/compiler/heptagon/parsing/hept_parser.mly index 8ccf3ff..61c474e 100644 --- a/compiler/heptagon/parsing/hept_parser.mly +++ b/compiler/heptagon/parsing/hept_parser.mly @@ -9,7 +9,7 @@ open Hept_parsetree %} -%token DOT LPAREN LPARENLPAREN RPAREN RPARENRPAREN LBRACE RBRACE COLON SEMICOL +%token DOT LPAREN LPAREN_LESS RPAREN GREATER_RPAREN LBRACE RBRACE COLON SEMICOL %token EQUAL EQUALEQUAL LESS_GREATER BARBAR COMMA BAR ARROW LET TEL %token Constructor %token IDENT @@ -429,9 +429,9 @@ _simple_exp: | LBRACE field_exp_list RBRACE { Estruct $2 } | LBRACKET array_exp_list RBRACKET { mk_call Earray $2 } | LPAREN tuple_exp RPAREN { mk_call Etuple $2 } - | simple_exp DOT c=qualname - { mk_call ~params:[mk_field_exp c (Loc($startpos(c),$endpos(c)))] - Efield [$1] } + | e=simple_exp DOT c=qualname + { mk_call ~params:[mk_field_exp c (Loc($startpos(c),$endpos(c)))] Efield [e] } +/* TODO : conflict with Eselect_dyn and or const*/ ; @@ -505,12 +505,12 @@ _exp: { mk_call Econcat [$1; $3] } /*Iterators*/ | it=iterator DOUBLE_LESS n=simple_exp DOUBLE_GREATER q=qualname - pargs=delim_slist(COMMA, LPARENLPAREN, RPARENRPAREN, exp) + pargs=delim_slist(COMMA, LPAREN_LESS, GREATER_RPAREN, exp) LPAREN args=exps RPAREN { mk_iterator_call it q [] n pargs args } | it=iterator DOUBLE_LESS n=simple_exp DOUBLE_GREATER LPAREN q=qualname DOUBLE_LESS sa=array_exp_list DOUBLE_GREATER RPAREN - pargs=delim_slist(COMMA, LPARENLPAREN, RPARENRPAREN, exp) + pargs=delim_slist(COMMA, LPAREN_LESS, GREATER_RPAREN, exp) LPAREN args=exps RPAREN { mk_iterator_call it q sa n pargs args } /*Records operators */ diff --git a/lib/pervasives.epi b/lib/pervasives.epi index 0b66f7c..8446fb4 100644 --- a/lib/pervasives.epi +++ b/lib/pervasives.epi @@ -14,14 +14,14 @@ val fun (-)(int;int) returns (int) val fun (-.)(float;float) returns (float) val fun (/)(int;int) returns (int) val fun (/.)(float;float) returns (float) -val fun (<=)(int;int) returns (bool) -val fun (<=.)(float;float) returns (bool) -val fun (<)(int;int) returns (bool) -val fun (<.)(float;float) returns (bool) -val fun (>=)(int;int) returns (bool) -val fun (>=.)(float;float) returns (bool) -val fun (>)(int;int) returns (bool) -val fun (>.)(float;float) returns (bool) +val fun ( <= )(int;int) returns (bool) +val fun ( <=. )(float;float) returns (bool) +val fun ( < )(int;int) returns (bool) +val fun ( <. )(float;float) returns (bool) +val fun ( >= )(int;int) returns (bool) +val fun ( >=. )(float;float) returns (bool) +val fun ( > )(int;int) returns (bool) +val fun ( >. )(float;float) returns (bool) val fun (not)(bool) returns (bool) val fun (or)(bool;bool) returns (bool) val fun (xor)(bool;bool) returns (bool) diff --git a/test/good/array2.ept b/test/good/array2.ept index 6cbff71..628ad1f 100644 --- a/test/good/array2.ept +++ b/test/good/array2.ept @@ -15,5 +15,5 @@ tel node p(a:int^n) returns (o:int^n) var acc:int; let - (o, acc) = mapfold sumdup <>(a, 0); + (o, acc) = mapfold<> sumdup (a, 0); tel diff --git a/test/good/array_iterators.ept b/test/good/array_iterators.ept index b80548f..241abef 100644 --- a/test/good/array_iterators.ept +++ b/test/good/array_iterators.ept @@ -7,7 +7,7 @@ tel node g(a:int^n) returns (o:int^n) let - o = map plusone <>(a); + o = map<> plusone (a); tel node sum_acc (a, acc_in:int) returns (acc_out:int) @@ -17,7 +17,7 @@ tel node h(a:int^n) returns (m:int) let - m = fold sum_acc <>(a, 0); + m = fold<> sum_acc (a, 0); tel node sum_dup (a, acc_in:int) returns (o:int; acc_out:int) @@ -29,17 +29,17 @@ tel node p(a:int^n) returns (o:int^n) var acc:int; let - (o, acc) = mapfold sum_dup <>(a, 0); + (o, acc) = mapfold<> sum_dup (a, 0); tel node k(a,b:int^n) returns (o:int^n) let - o = map (+) <>(a,b); + o = map<> (+) (a,b); tel node iter_reset(a:int^n; r:bool) returns (o:int^n) let reset - o = map plusone <>(a); + o = map<> plusone (a); every (r & r) tel \ No newline at end of file diff --git a/test/good/foldi.ept b/test/good/foldi.ept index df95577..b7d99f5 100644 --- a/test/good/foldi.ept +++ b/test/good/foldi.ept @@ -7,5 +7,5 @@ tel fun g(a: bool^n) returns (o:bool) let - o = foldi f <>(a, true); + o = foldi<> f (a, true); tel diff --git a/test/good/itfusion.ept b/test/good/itfusion.ept index 2450dc9..2cb714c 100644 --- a/test/good/itfusion.ept +++ b/test/good/itfusion.ept @@ -7,15 +7,15 @@ tel fun f1(a:int^n) returns (o:int^n) let - o = map inc <>(map inc <> (a)); + o = map<> inc (map<> inc (a)); tel fun f2(a,b:int^n) returns (o:int^n) let - o = map (+) <>(map inc <>(b), map inc <> (a)); + o = map<> (+) (map<> inc (b), map<> inc (a)); tel fun f3(a,b:int^n) returns (o:int^n) let - o = map (+) <>(b, map inc <> (a)); + o = map<> (+) (b, map<> inc (a)); tel \ No newline at end of file diff --git a/test/good/or_keep.ept b/test/good/or_keep.ept index beeb873..ee40dc9 100644 --- a/test/good/or_keep.ept +++ b/test/good/or_keep.ept @@ -5,7 +5,7 @@ tel node f<>(i : bool^n) returns (o, b : bool; nat : int) let - b = fold (or)<>(i, false); + b = fold<> (or) (i, false); automaton state Idle do o = false; nat = 0; @@ -24,4 +24,4 @@ let i2 = false fby true fby false; i3 = false; (o, b, nat) = f<<3>>([i1, i2, i3]); -tel \ No newline at end of file +tel diff --git a/test/good/parametrize.ept b/test/good/parametrize.ept index 26baebc..36cc782 100644 --- a/test/good/parametrize.ept +++ b/test/good/parametrize.ept @@ -25,6 +25,6 @@ tel node p(a:int^n^n) returns (o:int^n^n) let - o = map (l<>) <>(a); + o = map<> (l<>)(a); tel diff --git a/test/good/type_alias.ept b/test/good/type_alias.ept index 013013f..fc0aab2 100644 --- a/test/good/type_alias.ept +++ b/test/good/type_alias.ept @@ -11,12 +11,12 @@ tel fun g(a:tableau) returns (o:tableau) let - o = map f <>(a); + o = map<> f (a); tel fun h(a:matrice) returns (o:matrice) var x : matrice; let x = a; - o = map g <>(x); + o = map<> g (x); tel \ No newline at end of file