Browse Source

so that's what that did

Simon Krajewski 3 years ago
parent
commit
d377d0eaf1
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/syntax/grammar.mly

+ 8 - 2
src/syntax/grammar.mly

@@ -382,7 +382,10 @@ and parse_import s p1 =
 	| [< '(Semicolon,p2) >] ->
 	| [< '(Semicolon,p2) >] ->
 		p2
 		p2
 	| [< >] ->
 	| [< >] ->
-		syntax_error (Expected [".";";";"as"]) s (last_pos s)
+		if would_skip_display_position p1 true s then
+			display_position#with_pos p1
+		else
+			syntax_error (Expected [".";";";"as"]) s (last_pos s)
 	in
 	in
 	(EImport (path,mode),punion p1 p2)
 	(EImport (path,mode),punion p1 p2)
 
 
@@ -420,7 +423,10 @@ and parse_using s p1 =
 	| [< '(Semicolon,p2) >] ->
 	| [< '(Semicolon,p2) >] ->
 		p2
 		p2
 	| [< >] ->
 	| [< >] ->
-		syntax_error (Expected [".";";"]) s (last_pos s)
+		if would_skip_display_position p1 true s then
+			display_position#with_pos p1
+		else
+			syntax_error (Expected [".";";"]) s (last_pos s)
 	in
 	in
 	(EUsing path,punion p1 p2)
 	(EUsing path,punion p1 p2)