summaryrefslogtreecommitdiff
path: root/language/l2_parse.ott
diff options
context:
space:
mode:
authorKathy Gray2013-11-28 17:07:32 +0000
committerKathy Gray2013-11-28 17:07:32 +0000
commitdcc2ec2e4e6a3fd9a393af64d45bdf659201da03 (patch)
tree86ae08b56d12ed2e073ea984daee637b3f1afbb1 /language/l2_parse.ott
parent2b30446b6d2c5ae4accb7e4d00e9af5426990aee (diff)
Updated syntax with working examples
Diffstat (limited to 'language/l2_parse.ott')
-rw-r--r--language/l2_parse.ott14
1 files changed, 11 insertions, 3 deletions
diff --git a/language/l2_parse.ott b/language/l2_parse.ott
index 6876fcfa..f96c3f99 100644
--- a/language/l2_parse.ott
+++ b/language/l2_parse.ott
@@ -118,6 +118,12 @@ id :: '' ::=
| x :: :: id
| ( deinfix x ) :: :: deIid {{ com remove infix status }}
+
+var :: '' ::=
+ {{ com variables with kind, ticked to differntiate from program variables }}
+ {{ aux _ l }}
+ | ' x :: :: var
+
% Note: we have just a single namespace. We don't want the same
% identifier to be reused as a type name or variable, expression
% variable, and field name. We don't enforce any lexical convention
@@ -162,6 +168,7 @@ atyp :: 'ATyp_' ::=
{{ com expressions of all kinds, to be translated to types, nats, orders, and effects after parsing }}
{{ aux _ l }}
| id :: :: id {{ com identifier }}
+ | var :: :: var {{ com ticked variable }}
| num :: :: constant {{ com constant }}
| atyp1 * atyp2 :: :: times {{ com product }}
| atyp1 + atyp2 :: :: sum {{ com sum }}
@@ -171,6 +178,7 @@ atyp :: 'ATyp_' ::=
| inc :: :: inc {{ com increasing (little-endian) }}
| dec :: :: dec {{ com decreasing (big-endian) }}
| effect id :: :: efid
+ | effect var :: :: efvar
| effect { efct1 , .. , efctn } :: :: set {{ com effect set }}
| pure :: M :: pure {{ com sugar for empty effect set }} {{ icho [] }}
@@ -237,8 +245,8 @@ nexp_constraint :: 'NC_' ::=
kinded_id :: 'KOpt_' ::=
{{ com optionally kind-annotated identifier }}
{{ aux _ l }}
- | id :: :: none {{ com identifier }}
- | kind id :: :: kind {{ com kind-annotated variable }}
+ | var :: :: none {{ com identifier }}
+ | kind var :: :: kind {{ com kind-annotated variable }}
quant_item :: 'QI_' ::=
{{ com Either a kinded identifier or a nexp constraint for a typquant }}
@@ -682,7 +690,7 @@ default_typing_spec :: 'DT_' ::=
{{ com Default kinding or typing assumption }}
{{ aux _ l }}
% {{ aux _ annot }} {{ auxparam 'a }}
- | default base_kind id :: :: kind
+ | default base_kind var :: :: kind
| default typschm id :: :: typ
% The intended semantics of these is that if an id in binding position
% doesn't have a kind or type annotation, then we look through the