Browse Source

optional semicolon after typedef

Nicolas Cannasse 18 years ago
parent
commit
e7aae26dec
2 changed files with 5 additions and 1 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 4 1
      parser.ml

+ 1 - 0
doc/CHANGES.txt

@@ -7,6 +7,7 @@
 	fixed haxe.remoting.SocketConnection (msg invertions might occur)
 	add uniqueness check for switch constants
 	js : HtmlCollection and MetaDom.childNodes are not true Arrays
+	allowed semicolon after typedef declaration
 
 2007-03-06: 1.12
 	added flash lite support with -D flash_lite

+ 4 - 1
parser.ml

@@ -182,7 +182,10 @@ and parse_type_decl s =
 				d_flags = List.map fst c @ n @ hl;
 				d_data = fl;
 			}, punion p1 p2)
-		| [< '(Kwd Typedef,p1); doc = get_doc; '(Const (Type name),p2); tl = parse_constraint_params; '(Binop OpAssign,_); t = parse_type_path >] ->
+		| [< '(Kwd Typedef,p1); doc = get_doc; '(Const (Type name),p2); tl = parse_constraint_params; '(Binop OpAssign,_); t = parse_type_path; s >] ->
+			(match s with parser
+			| [< '(Semicolon,_) >] -> ()
+			| [< >] -> ());
 			(ETypedef {
 				d_name = name;
 				d_doc = doc;