fixed tests to the new iterator syntax.
Changed (( and )) to (< and >) since it's very common to write )) !
This commit is contained in:
parent
b913edcd5e
commit
36061f4518
10 changed files with 31 additions and 31 deletions
|
@ -121,9 +121,9 @@ rule token = parse
|
|||
| [' ' '\t'] + { token lexbuf }
|
||||
| "." {DOT}
|
||||
| "(" {LPAREN}
|
||||
| "((" {LPARENLPAREN}
|
||||
| "(<" {LPAREN_LESS}
|
||||
| ")" {RPAREN}
|
||||
| "))" {RPARENRPAREN}
|
||||
| ">)" {GREATER_RPAREN}
|
||||
| "*" { STAR }
|
||||
| "{" {LBRACE}
|
||||
| "}" {RBRACE}
|
||||
|
|
|
@ -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 <string> Constructor
|
||||
%token <string> 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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -15,5 +15,5 @@ tel
|
|||
node p(a:int^n) returns (o:int^n)
|
||||
var acc:int;
|
||||
let
|
||||
(o, acc) = mapfold sumdup <<n>>(a, 0);
|
||||
(o, acc) = mapfold<<n>> sumdup (a, 0);
|
||||
tel
|
||||
|
|
|
@ -7,7 +7,7 @@ tel
|
|||
|
||||
node g(a:int^n) returns (o:int^n)
|
||||
let
|
||||
o = map plusone <<n>>(a);
|
||||
o = map<<n>> 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 <<n>>(a, 0);
|
||||
m = fold<<n>> 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 <<n>>(a, 0);
|
||||
(o, acc) = mapfold<<n>> sum_dup (a, 0);
|
||||
tel
|
||||
|
||||
node k(a,b:int^n) returns (o:int^n)
|
||||
let
|
||||
o = map (+) <<n>>(a,b);
|
||||
o = map<<n>> (+) (a,b);
|
||||
tel
|
||||
|
||||
node iter_reset(a:int^n; r:bool) returns (o:int^n)
|
||||
let
|
||||
reset
|
||||
o = map plusone <<n>>(a);
|
||||
o = map<<n>> plusone (a);
|
||||
every (r & r)
|
||||
tel
|
|
@ -7,5 +7,5 @@ tel
|
|||
|
||||
fun g(a: bool^n) returns (o:bool)
|
||||
let
|
||||
o = foldi f <<n>>(a, true);
|
||||
o = foldi<<n>> f (a, true);
|
||||
tel
|
||||
|
|
|
@ -7,15 +7,15 @@ tel
|
|||
|
||||
fun f1(a:int^n) returns (o:int^n)
|
||||
let
|
||||
o = map inc <<n>>(map inc <<n>> (a));
|
||||
o = map<<n>> inc (map<<n>> inc (a));
|
||||
tel
|
||||
|
||||
fun f2(a,b:int^n) returns (o:int^n)
|
||||
let
|
||||
o = map (+) <<n>>(map inc <<n>>(b), map inc <<n>> (a));
|
||||
o = map<<n>> (+) (map<<n>> inc (b), map<<n>> inc (a));
|
||||
tel
|
||||
|
||||
fun f3(a,b:int^n) returns (o:int^n)
|
||||
let
|
||||
o = map (+) <<n>>(b, map inc <<n>> (a));
|
||||
o = map<<n>> (+) (b, map<<n>> inc (a));
|
||||
tel
|
|
@ -5,7 +5,7 @@ tel
|
|||
|
||||
node f<<n : int>>(i : bool^n) returns (o, b : bool; nat : int)
|
||||
let
|
||||
b = fold (or)<<n>>(i, false);
|
||||
b = fold<<n>> (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
|
||||
tel
|
||||
|
|
|
@ -25,6 +25,6 @@ tel
|
|||
|
||||
node p(a:int^n^n) returns (o:int^n^n)
|
||||
let
|
||||
o = map (l<<n>>) <<n>>(a);
|
||||
o = map<<n>> (l<<n>>)(a);
|
||||
tel
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@ tel
|
|||
|
||||
fun g(a:tableau) returns (o:tableau)
|
||||
let
|
||||
o = map f <<n>>(a);
|
||||
o = map<<n>> f (a);
|
||||
tel
|
||||
|
||||
fun h(a:matrice) returns (o:matrice)
|
||||
var x : matrice;
|
||||
let
|
||||
x = a;
|
||||
o = map g <<n>>(x);
|
||||
o = map<<n>> g (x);
|
||||
tel
|
Loading…
Reference in a new issue