diff src/lacweb.grm @ 18:9a578171de9e

Unification wildcards
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 14:25:27 -0400
parents 1e645beb3f3b
children e6ccf961d8a3
line wrap: on
line diff
--- a/src/lacweb.grm	Sun Jun 08 14:10:51 2008 -0400
+++ b/src/lacweb.grm	Sun Jun 08 14:25:27 2008 -0400
@@ -39,7 +39,7 @@
  | STRING of string | INT of Int64.int | FLOAT of Real64.real
  | SYMBOL of string | CSYMBOL of string
  | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE
- | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH
+ | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER
  | CON | LTYPE | VAL
  | TYPE | NAME
  | ARROW | LARROW | DARROW
@@ -102,6 +102,7 @@
        | LBRACE kind RBRACE             (KRecord kind, s (LBRACEleft, RBRACEright))
        | kind ARROW kind                (KArrow (kind1, kind2), s (kind1left, kind2right))
        | LPAREN kind RPAREN             (#1 kind, s (LPARENleft, RPARENright))
+       | UNDERUNDER                     (KWild, s (UNDERUNDERleft, UNDERUNDERright))
 
 capps  : cterm                          (cterm)
        | capps cterm                    (CApp (capps, cterm), s (cappsleft, ctermright))
@@ -116,6 +117,8 @@
 
        | LPAREN cexp RPAREN DCOLON kind (CAnnot (cexp, kind), s (LPARENleft, kindright))
 
+       | UNDER DCOLON kind              (CWild kind, s (UNDERleft, UNDERright))
+
 kcolon : DCOLON                         (Explicit)
        | TCOLON                         (Implicit)
 
@@ -127,6 +130,7 @@
        | HASH CSYMBOL                   (CName CSYMBOL, s (HASHleft, CSYMBOLright))
 
        | SYMBOL                         (CVar SYMBOL, s (SYMBOLleft, SYMBOLright))
+       | UNDER                          (CWild (KWild, s (UNDERleft, UNDERright)), s (UNDERleft, UNDERright))
 
 rcon   :                                ([])
        | ident EQ cexp                  ([(ident, cexp)])