Commit 83bc8de4 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-14 07:58:18 by cvscast] Parsing error when type id is not capitalized

Original author: cvscast
Date: 2003-05-14 07:58:18+00:00
parent 9f27cb97
......@@ -93,6 +93,7 @@ EXTEND
| (p,e1) = let_binding; "in"; e2 = expr LEVEL "top"->
[ mk loc (EvalStatement (exp loc (Match (e1,[p,e2])))) ]
| LIDENT "type"; x = UIDENT; "="; t = pat -> [ mk loc (TypeDecl (x,t)) ]
| LIDENT "type"; x = LIDENT -> [ error loc "Type identifiers must be capitalized" ]
| LIDENT "debug"; d = debug_directive -> [ mk loc (Debug d) ]
| LIDENT "include"; s = STRING2 ->
let s = get_string s in
......@@ -337,7 +338,9 @@ EXTEND
pat: [
[ x = pat; LIDENT "where";
b = LIST1 [ a = UIDENT; "="; y = pat -> (a,y)] SEP "and"
b = LIST1 [ a = UIDENT; "="; y = pat -> (a,y)
| LIDENT -> error loc "Type/pattern identifiers must be capitalized"
] SEP "and"
-> mk loc (Recurs (x,b)) ]
| RIGHTA [ x = pat; "->"; y = pat -> mk loc (Arrow (x,y)) ]
| "no_arrow" [ x = pat; "|"; y = pat -> mk loc (Or (x,y)) ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment