Explorar el Código

allow leading comma in anonymous types

Nicolas Cannasse hace 18 años
padre
commit
a356b0ec73
Se han modificado 2 ficheros con 6 adiciones y 4 borrados
  1. 1 0
      doc/CHANGES.txt
  2. 5 4
      parser.ml

+ 1 - 0
doc/CHANGES.txt

@@ -13,6 +13,7 @@
 	give access to neko.net.Host ip (as Int32)
 	give access to neko.net.Host ip (as Int32)
 	fixed bug when calling super.UpperCaseMethod()
 	fixed bug when calling super.UpperCaseMethod()
 	hide additional flash Array methods
 	hide additional flash Array methods
+	allow leading comma in anonymous types
 
 
 2007-01-28: 1.11
 2007-01-28: 1.11
 	changed StringBuf.add implementation
 	changed StringBuf.add implementation

+ 5 - 4
parser.ml

@@ -316,12 +316,13 @@ and parse_type_anonymous_resume name = parser
 		(name, None, AFVar t, p) ::
 		(name, None, AFVar t, p) ::
 		match s with parser
 		match s with parser
 		| [< '(BrClose,_) >] -> []
 		| [< '(BrClose,_) >] -> []
-		| [< '(Comma,_); l = psep Comma parse_type_anonymous; '(BrClose,_) >] -> l
+		| [< '(Comma,_) >] ->
+			(match s with parser
+			| [< '(BrClose,_) >] -> []
+			| [< name = any_ident; s >] -> parse_type_anonymous_resume name s
+			| [< >] -> serror());
 		| [< >] -> serror()
 		| [< >] -> serror()
 
 
-and parse_type_anonymous = parser
-	| [< name = any_ident; '(DblDot,p); t = parse_type_path >] -> (name, None, AFVar t, p)
-
 and parse_enum s =
 and parse_enum s =
 	doc := None;
 	doc := None;
 	match s with parser
 	match s with parser