Commit c2584813 authored by POTTIER Francois's avatar POTTIER Francois

Remove [Positions.two].

It is replaced with [Positions.import] in a singleton list.
parent 6636a4a7
......@@ -129,7 +129,7 @@ declaration:
| rule_specific_token
{
Error.error (Positions.two $startpos $endpos)
Error.error [Positions.import $loc]
"syntax error inside a declaration.\n\
Did you perhaps forget the %%%% that separates declarations and rules?"
}
......
......@@ -75,7 +75,7 @@ module TokPrecedence = struct
| UndefinedPrecedence ->
()
| PrecedenceLevel (_, _, pos1, pos2) ->
Error.grammar_warning (Positions.two pos1 pos2)
Error.grammar_warning [Positions.import (pos1, pos2)]
"the precedence level assigned to %s is never useful." id
) grammar.tokens
......
......@@ -26,7 +26,7 @@ let error1 pos =
Error.error (Positions.one pos)
let error2 lexbuf =
Error.error (Positions.two lexbuf.lex_start_p lexbuf.lex_curr_p)
Error.error (Positions.lexbuf lexbuf)
(* ------------------------------------------------------------------------ *)
......
......@@ -140,9 +140,6 @@ type positions =
let one (pos : position) : positions =
[ import (pos, pos) ]
let two (pos1 : position) (pos2 : position) : positions =
[ import (pos1, pos2) ]
let lexbuf (lexbuf : lexbuf) : positions =
[ import (lexbuf.lex_start_p, lexbuf.lex_curr_p) ]
......
......@@ -123,8 +123,6 @@ type positions =
val one: Lexing.position -> positions
val two: Lexing.position -> Lexing.position -> positions
val lexbuf: Lexing.lexbuf -> positions
(* Low-level printing function, for debugging. *)
......
......@@ -23,7 +23,7 @@
(* A short-hand. *)
let error2 lexbuf =
Error.error (Positions.two lexbuf.lex_start_p lexbuf.lex_curr_p)
Error.error (Positions.lexbuf lexbuf)
}
......@@ -84,4 +84,3 @@ rule lex = parse
{ COLON }
| _
{ error2 lexbuf "unexpected character." }
......@@ -66,7 +66,7 @@
| None, [] ->
Lexing.dummy_pos (* cannot happen *)
in
Positions.two opening closing,
[Positions.import (opening, closing)],
strip_sentence (nto, terminals)
%}
......@@ -118,4 +118,3 @@ terminals:
{ [] }
| TERMINAL terminals
{ $1 :: $2 }
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