diff options
| author | Kathy Gray | 2014-06-23 15:57:26 +0100 |
|---|---|---|
| committer | Kathy Gray | 2014-06-23 15:58:37 +0100 |
| commit | edad894f962a4aa07036d6435364b6919add8085 (patch) | |
| tree | b690e4792baf3d97b1081fc26ac447b64b915497 /language | |
| parent | f4d86db24045315c87cbe3509485e3524b725a7c (diff) | |
Get indexed vectors, particularly with default values, working
Diffstat (limited to 'language')
| -rw-r--r-- | language/l2_parse.ml | 2 | ||||
| -rw-r--r-- | language/l2_parse.ott | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/language/l2_parse.ml b/language/l2_parse.ml index c68c92b9..3146ad2b 100644 --- a/language/l2_parse.ml +++ b/language/l2_parse.ml @@ -208,7 +208,7 @@ exp_aux = (* Expression *) | E_if of exp * exp * exp (* conditional *) | E_for of id * exp * exp * exp * atyp * exp (* loop *) | E_vector of (exp) list (* vector (indexed from 0) *) - | E_vector_indexed of ((int * exp)) list * opt_default (* vector (indexed consecutively) *) + | E_vector_indexed of (exp) list * opt_default (* vector (indexed consecutively) *) | E_vector_access of exp * exp (* vector access *) | E_vector_subrange of exp * exp * exp (* subvector extraction *) | E_vector_update of exp * exp * exp (* vector functional update *) diff --git a/language/l2_parse.ott b/language/l2_parse.ott index d3e13c13..f1149301 100644 --- a/language/l2_parse.ott +++ b/language/l2_parse.ott @@ -452,7 +452,7 @@ exp :: 'E_' ::= % here the expi are of type 'a and the result is a vector of 'a, whereas in exp1 : ... : expn % the expi and the result are both of type vector of 'a - | [ num1 = exp1 , ... , numn = expn , opt_default ] :: :: vector_indexed {{ com vector (indexed consecutively) }} + | [ exp1 , ... , expn , opt_default ] :: :: vector_indexed {{ com vector (indexed consecutively) }} % num1 .. numn must be a consecutive list of naturals % we pick [ ] not { } for vector literals for consistency with their |
