Explorar o código

make some semicolons optional in display mode

Simon Krajewski %!s(int64=9) %!d(string=hai) anos
pai
achega
6aa94a7f2c
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/syntax/parser.ml

+ 3 - 3
src/syntax/parser.ml

@@ -1032,14 +1032,14 @@ and parse_class_field s =
 				let t = popt parse_type_hint_with_pos s in
 				let t = popt parse_type_hint_with_pos s in
 				let e , p2 = (match s with parser
 				let e , p2 = (match s with parser
 				| [< '(Binop OpAssign,_); e = toplevel_expr; p2 = semicolon >] -> Some e , p2
 				| [< '(Binop OpAssign,_); e = toplevel_expr; p2 = semicolon >] -> Some e , p2
-				| [< '(Semicolon,p2) >] -> None , p2
+				| [< p2 = semicolon >] -> None , p2
 				| [< >] -> serror()
 				| [< >] -> serror()
 				) in
 				) in
 				name, punion p1 p2, FProp (i1,i2,t, e)
 				name, punion p1 p2, FProp (i1,i2,t, e)
 			| [< t = popt parse_type_hint_with_pos; s >] ->
 			| [< t = popt parse_type_hint_with_pos; s >] ->
 				let e , p2 = (match s with parser
 				let e , p2 = (match s with parser
 				| [< '(Binop OpAssign,_); e = toplevel_expr; p2 = semicolon >] -> Some e , p2
 				| [< '(Binop OpAssign,_); e = toplevel_expr; p2 = semicolon >] -> Some e , p2
-				| [< '(Semicolon,p2) >] -> None , p2
+				| [< p2 = semicolon >] -> None , p2
 				| [< >] -> serror()
 				| [< >] -> serror()
 				) in
 				) in
 				name, punion p1 p2, FVar (t,e))
 				name, punion p1 p2, FVar (t,e))
@@ -1048,7 +1048,7 @@ and parse_class_field s =
 				| [< e = toplevel_expr; s >] ->
 				| [< e = toplevel_expr; s >] ->
 					(try ignore(semicolon s) with Error (Missing_semicolon,p) -> !display_error Missing_semicolon p);
 					(try ignore(semicolon s) with Error (Missing_semicolon,p) -> !display_error Missing_semicolon p);
 					Some e, pos e
 					Some e, pos e
-				| [< '(Semicolon,p) >] -> None, p
+				| [< p = semicolon >] -> None, p
 				| [< >] -> serror()
 				| [< >] -> serror()
 			) in
 			) in
 			let f = {
 			let f = {