Prechádzať zdrojové kódy

allow leading comma in anonymous types

Nicolas Cannasse 18 rokov pred
rodič
commit
a356b0ec73
2 zmenil súbory, kde vykonal 6 pridanie a 4 odobranie
  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)
 	fixed bug when calling super.UpperCaseMethod()
 	hide additional flash Array methods
+	allow leading comma in anonymous types
 
 2007-01-28: 1.11
 	changed StringBuf.add implementation

+ 5 - 4
parser.ml

@@ -316,12 +316,13 @@ and parse_type_anonymous_resume name = parser
 		(name, None, AFVar t, p) ::
 		match s with parser
 		| [< '(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()
 
-and parse_type_anonymous = parser
-	| [< name = any_ident; '(DblDot,p); t = parse_type_path >] -> (name, None, AFVar t, p)
-
 and parse_enum s =
 	doc := None;
 	match s with parser