summaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
authorKathy Gray2016-08-14 12:37:46 +0100
committerKathy Gray2016-08-14 12:37:46 +0100
commitac9aa3b73181cf6f8a0bbcf2c59562ec17c7c8ea (patch)
tree18ca622f78c0fd51ff0c8b85b3b02c4a4dc9fe57 /language
parent5c31607a52606cd5671d7d65627ac37cc9f117c8 (diff)
Start adding form for (a,b,c) := foo()
Not working yet
Diffstat (limited to 'language')
-rw-r--r--language/l2.lem1
-rw-r--r--language/l2.ml1
-rw-r--r--language/l2.ott1
-rw-r--r--language/l2_parse.ml2
-rw-r--r--language/l2_parse.ott2
5 files changed, 5 insertions, 2 deletions
diff --git a/language/l2.lem b/language/l2.lem
index 88953684..64b3006c 100644
--- a/language/l2.lem
+++ b/language/l2.lem
@@ -277,6 +277,7 @@ and lexp_aux 'a = (* lvalue expression *)
| LEXP_id of id (* identifier *)
| LEXP_memory of id * list (exp 'a) (* memory write via function call *)
| LEXP_cast of typ * id
+ | LEXP_tup of list (lexp 'a) (* set multiple at a time, a check will ensure it's not memory *)
| LEXP_vector of (lexp 'a) * (exp 'a) (* vector element *)
| LEXP_vector_range of (lexp 'a) * (exp 'a) * (exp 'a) (* subvector *)
| LEXP_field of (lexp 'a) * id (* struct field *)
diff --git a/language/l2.ml b/language/l2.ml
index 1a35432b..bae88cab 100644
--- a/language/l2.ml
+++ b/language/l2.ml
@@ -291,6 +291,7 @@ and 'a lexp_aux = (* lvalue expression *)
LEXP_id of id (* identifier *)
| LEXP_memory of id * ('a exp) list (* memory write via function call *)
| LEXP_cast of typ * id
+ | LEXP_tup of ('a lexp) list (* set multiple at a time, a check will ensure it's not memory *)
| LEXP_vector of 'a lexp * 'a exp (* vector element *)
| LEXP_vector_range of 'a lexp * 'a exp * 'a exp (* subvector *)
| LEXP_field of 'a lexp * id (* struct field *)
diff --git a/language/l2.ott b/language/l2.ott
index 96483b90..80bb5e26 100644
--- a/language/l2.ott
+++ b/language/l2.ott
@@ -689,6 +689,7 @@ lexp :: 'LEXP_' ::= {{ com lvalue expression }}
| id ( exp1 , .. , expn ) :: :: memory {{ com memory write via function call }}
| id exp :: S :: mem_tup {{ ichlo [[id (exp)]] }}
| ( typ ) id :: :: cast
+ | ( lexp0 , .. , lexpn ) :: :: tup {{ com set multiple at a time, a check will ensure it's not memory }}
| lexp [ exp ] :: :: vector {{ com vector element }}
| lexp [ exp1 '..' exp2 ] :: :: vector_range {{ com subvector }}
% maybe comma-sep such lists too
diff --git a/language/l2_parse.ml b/language/l2_parse.ml
index cf1da35a..8393207c 100644
--- a/language/l2_parse.ml
+++ b/language/l2_parse.ml
@@ -449,7 +449,7 @@ def = (* Top-level definition *)
type
-lexp_aux = (* lvalue expression *)
+lexp_aux = (* lvalue expression, can't occur out of the parser *)
LEXP_id of id (* identifier *)
| LEXP_mem of id * (exp) list
| LEXP_vector of lexp * exp (* vector element *)
diff --git a/language/l2_parse.ott b/language/l2_parse.ott
index f1e994f6..28803cb6 100644
--- a/language/l2_parse.ott
+++ b/language/l2_parse.ott
@@ -552,7 +552,7 @@ exp :: 'E_' ::=
| ( exp ) :: S :: paren {{ ichlo [[exp]] }}
-lexp :: 'LEXP_' ::= {{ com lvalue expression }}
+lexp :: 'LEXP_' ::= {{ com lvalue expression, can't occur out of the parser }}
{{ aux _ l }}
% {{ aux _ annot }} {{ auxparam 'a }}
| id :: :: id