Mercurial > urweb
comparison src/urweb.grm @ 821:395a5d450cc0
Chars and more string operations
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 26 May 2009 12:25:06 -0400 |
parents | e2780d2f4afc |
children | d4e811beb8eb |
comparison
equal
deleted
inserted
replaced
820:91f465ded07e | 821:395a5d450cc0 |
---|---|
181 %% | 181 %% |
182 %header (functor UrwebLrValsFn(structure Token : TOKEN)) | 182 %header (functor UrwebLrValsFn(structure Token : TOKEN)) |
183 | 183 |
184 %term | 184 %term |
185 EOF | 185 EOF |
186 | STRING of string | INT of Int64.int | FLOAT of Real64.real | 186 | STRING of string | INT of Int64.int | FLOAT of Real64.real | CHAR of char |
187 | SYMBOL of string | CSYMBOL of string | 187 | SYMBOL of string | CSYMBOL of string |
188 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE | 188 | LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE |
189 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR | 189 | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR |
190 | PLUS | MINUS | DIVIDE | DOTDOTDOT | MOD | AT | 190 | PLUS | MINUS | DIVIDE | DOTDOTDOT | MOD | AT |
191 | CON | LTYPE | VAL | REC | AND | FUN | MAP | UNIT | KUNIT | CLASS | 191 | CON | LTYPE | VAL | REC | AND | FUN | MAP | UNIT | KUNIT | CLASS |
1078 | UNIT (ERecord [], s (UNITleft, UNITright)) | 1078 | UNIT (ERecord [], s (UNITleft, UNITright)) |
1079 | 1079 |
1080 | INT (EPrim (Prim.Int INT), s (INTleft, INTright)) | 1080 | INT (EPrim (Prim.Int INT), s (INTleft, INTright)) |
1081 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) | 1081 | FLOAT (EPrim (Prim.Float FLOAT), s (FLOATleft, FLOATright)) |
1082 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) | 1082 | STRING (EPrim (Prim.String STRING), s (STRINGleft, STRINGright)) |
1083 | CHAR (EPrim (Prim.Char CHAR), s (CHARleft, CHARright)) | |
1083 | 1084 |
1084 | path DOT idents (let | 1085 | path DOT idents (let |
1085 val loc = s (pathleft, identsright) | 1086 val loc = s (pathleft, identsright) |
1086 in | 1087 in |
1087 foldl (fn (ident, e) => | 1088 foldl (fn (ident, e) => |
1226 pterm : SYMBOL (PVar SYMBOL, s (SYMBOLleft, SYMBOLright)) | 1227 pterm : SYMBOL (PVar SYMBOL, s (SYMBOLleft, SYMBOLright)) |
1227 | cpath (PCon (#1 cpath, #2 cpath, NONE), s (cpathleft, cpathright)) | 1228 | cpath (PCon (#1 cpath, #2 cpath, NONE), s (cpathleft, cpathright)) |
1228 | UNDER (PWild, s (UNDERleft, UNDERright)) | 1229 | UNDER (PWild, s (UNDERleft, UNDERright)) |
1229 | INT (PPrim (Prim.Int INT), s (INTleft, INTright)) | 1230 | INT (PPrim (Prim.Int INT), s (INTleft, INTright)) |
1230 | STRING (PPrim (Prim.String STRING), s (STRINGleft, STRINGright)) | 1231 | STRING (PPrim (Prim.String STRING), s (STRINGleft, STRINGright)) |
1232 | CHAR (PPrim (Prim.Char CHAR), s (CHARleft, CHARright)) | |
1231 | LPAREN pat RPAREN (pat) | 1233 | LPAREN pat RPAREN (pat) |
1232 | LBRACE RBRACE (PRecord ([], false), s (LBRACEleft, RBRACEright)) | 1234 | LBRACE RBRACE (PRecord ([], false), s (LBRACEleft, RBRACEright)) |
1233 | UNIT (PRecord ([], false), s (UNITleft, UNITright)) | 1235 | UNIT (PRecord ([], false), s (UNITleft, UNITright)) |
1234 | LBRACE rpat RBRACE (PRecord rpat, s (LBRACEleft, RBRACEright)) | 1236 | LBRACE rpat RBRACE (PRecord rpat, s (LBRACEleft, RBRACEright)) |
1235 | LPAREN ptuple RPAREN (PRecord (ListUtil.mapi (fn (i, p) => (Int.toString (i + 1), p)) ptuple, | 1237 | LPAREN ptuple RPAREN (PRecord (ListUtil.mapi (fn (i, p) => (Int.toString (i + 1), p)) ptuple, |