[svn] r7439: nemerle/trunk/ncc: parsing/MainParser.n
testsuite/negative/parser.n
nazgul
svnadmin at nemerle.org
Fri Feb 16 19:14:01 CET 2007
Log:
Fix crash on empty typeof
Author: nazgul
Date: Fri Feb 16 19:13:58 2007
New Revision: 7439
Modified:
nemerle/trunk/ncc/parsing/MainParser.n
nemerle/trunk/ncc/testsuite/negative/parser.n
Modified: nemerle/trunk/ncc/parsing/MainParser.n
==============================================================================
--- nemerle/trunk/ncc/parsing/MainParser.n (original)
+++ nemerle/trunk/ncc/parsing/MainParser.n Fri Feb 16 19:13:58 2007
@@ -1970,10 +1970,10 @@
| Token.Keyword ("_") => PExpr.Wildcard (loc)
| Token.Keyword ("typeof") =>
match (get_token ()) {
- | Token.RoundGroup (child) =>
+ | Token.RoundGroup (child) as g =>
match (parse_expr_sequence (child, [])) {
| [x] => PExpr.Typeof (loc, x)
- | _ => fatal_error (child.Location, "expecting single type in `typeof (...)'");
+ | _ => fatal_error (g.Location, "expecting single type in `typeof (...)'");
}
| x => fatal_error (x, "expecting `(..)' after `typeof'");
}
Modified: nemerle/trunk/ncc/testsuite/negative/parser.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/parser.n (original)
+++ nemerle/trunk/ncc/testsuite/negative/parser.n Fri Feb 16 19:13:58 2007
@@ -21,6 +21,11 @@
}
}
+ typof () : void {
+ typeof (); // E: expecting single type in.*typeof.*
+
+ }
+
faa () : void {
match (3) {
| 1 => // E: match case body cannot be empty
More information about the svn
mailing list