Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 13bd0b0f authored by POTTIER Francois's avatar POTTIER Francois

Very slight improvement in the positions produced by [Lexer] on an error.

parent 73d7abcc
...@@ -257,6 +257,9 @@ ...@@ -257,6 +257,9 @@
let error1 pos msg = let error1 pos msg =
Error.error (Positions.one pos) msg Error.error (Positions.one pos) msg
let error2 lexbuf msg =
Error.error (Positions.two lexbuf.lex_start_p lexbuf.lex_curr_p) msg
} }
let newline = ('\010' | '\013' | "\013\010") let newline = ('\010' | '\013' | "\013\010")
...@@ -374,7 +377,7 @@ rule main = parse ...@@ -374,7 +377,7 @@ rule main = parse
| eof | eof
{ EOF } { EOF }
| _ | _
{ error1 (lexeme_start_p lexbuf) "unexpected character(s)." } { error2 lexbuf "unexpected character(s)." }
(* Skip C style comments. *) (* Skip C style comments. *)
...@@ -437,7 +440,7 @@ and action percent openingpos pkeywords = parse ...@@ -437,7 +440,7 @@ and action percent openingpos pkeywords = parse
{ let pkeyword = mk_keyword lexbuf w f n id in { let pkeyword = mk_keyword lexbuf w f n id in
action percent openingpos (pkeyword :: pkeywords) lexbuf } action percent openingpos (pkeyword :: pkeywords) lexbuf }
| previouserror | previouserror
{ error1 (lexeme_start_p lexbuf) "$previouserror is no longer supported." } { error2 lexbuf "$previouserror is no longer supported." }
| syntaxerror | syntaxerror
{ let pkeyword = with_cpos lexbuf Keyword.PSyntaxError in { let pkeyword = with_cpos lexbuf Keyword.PSyntaxError in
action percent openingpos (pkeyword :: pkeywords) lexbuf } action percent openingpos (pkeyword :: pkeywords) lexbuf }
...@@ -475,7 +478,7 @@ and parentheses openingpos pkeywords = parse ...@@ -475,7 +478,7 @@ and parentheses openingpos pkeywords = parse
{ let pkeyword = mk_keyword lexbuf w f n id in { let pkeyword = mk_keyword lexbuf w f n id in
parentheses openingpos (pkeyword :: pkeywords) lexbuf } parentheses openingpos (pkeyword :: pkeywords) lexbuf }
| previouserror | previouserror
{ error1 (lexeme_start_p lexbuf) "$previouserror is no longer supported." } { error2 lexbuf "$previouserror is no longer supported." }
| syntaxerror | syntaxerror
{ let pkeyword = with_cpos lexbuf Keyword.PSyntaxError in { let pkeyword = with_cpos lexbuf Keyword.PSyntaxError in
parentheses openingpos (pkeyword :: pkeywords) lexbuf } parentheses openingpos (pkeyword :: pkeywords) lexbuf }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment