summaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
authorKathy Gray2014-06-12 17:35:00 +0200
committerKathy Gray2014-06-12 17:48:47 +0200
commit89eb6678e6b2eabe5fd30f772df7587d668dff9b (patch)
treebcc0e7dc4b6b70828758c463fd5679901675d1a5 /language
parent07c2c742b94f35a9c95ebabd58b6799ec58f1059 (diff)
Interpret when an unknown is inserted into the program by interp_exhaustive
Short version of below; ready to hook interp_exhaustive up to something to test, but haven't yet. If an unknown value influences a pattern match within an expression, each passing pattern is found and the bodies strung together into a block with let expressions to bind the variables. In a function call, the cases are all collected but the support is not in place at the moment to evaluate them. If an unknown is the result of the cond expression in an if, the then and else case become a block. Unknowns within the interpreter propagate to more Unknowns; also for some but not all library functions yet.
Diffstat (limited to 'language')
-rw-r--r--language/l2.lem1
-rw-r--r--language/l2_typ.ott3
2 files changed, 3 insertions, 1 deletions
diff --git a/language/l2.lem b/language/l2.lem
index d82fbbc7..b19639bb 100644
--- a/language/l2.lem
+++ b/language/l2.lem
@@ -506,6 +506,7 @@ and t_args = (* Arguments to type constructors *)
type tag = (* Data indicating where the identifier arises and thus information necessary in compilation *)
| Tag_empty
+ | Tag_global (* Globally let-bound or enumeration based value/variable *)
| Tag_ctor (* Data constructor from a type union *)
| Tag_extern of maybe string (* External function, specied only with a val statement *)
| Tag_default (* Type has come from default declaration, identifier may not be bound locally *)
diff --git a/language/l2_typ.ott b/language/l2_typ.ott
index a5346d8f..a3d6b15f 100644
--- a/language/l2_typ.ott
+++ b/language/l2_typ.ott
@@ -60,7 +60,8 @@ optx :: '' ::= {{ phantom }} {{ lem maybe string }} {{ ocaml string option }}
tag :: 'Tag_' ::=
{{ com Data indicating where the identifier arises and thus information necessary in compilation }}
- | None :: :: empty
+ | None :: :: empty
+ | Global :: :: global {{ com Globally let-bound or enumeration based value/variable }}
| Ctor :: :: ctor {{ com Data constructor from a type union }}
| Extern optx :: :: extern {{ com External function, specied only with a val statement }}
| Default :: :: default {{ com Type has come from default declaration, identifier may not be bound locally }}