Commit f7876493 authored by POTTIER Francois's avatar POTTIER Francois

Change the API of [ParserAux.new_precedence_level]. Use [$loc].

parent 2d225824
......@@ -106,7 +106,7 @@ declaration:
(List.map Parameters.with_pos ss) }
| k = priority_keyword ss = clist(symbol)
{ let prec = ParserAux.new_precedence_level $startpos(k) $endpos(k) in
{ let prec = ParserAux.new_precedence_level $loc(k) in
List.map (Positions.map (fun symbol -> DTokenProperties (symbol, k, prec))) ss }
| PARAMETER t = OCAMLTYPE
......
......@@ -34,7 +34,7 @@ type early_productions =
let new_precedence_level =
let c = ref 0 in
fun pos1 pos2 ->
fun (pos1, pos2) ->
incr c;
PrecedenceLevel (InputFile.get_input_file (), !c, pos1, pos2)
......
......@@ -37,7 +37,7 @@ type early_production =
type early_productions =
early_production list
(* [new_precedence_level pos1 pos2] creates a new precendence level, which is
(* [new_precedence_level (pos1, pos2)] creates a new precendence level, which is
stronger than any levels previously created by this function. It should be
called every time a [%left], [%right], or [%nonassoc] declaration is found.
The positions are the positions of this declaration in the source code. The
......@@ -45,7 +45,7 @@ type early_productions =
%prec) to productions. They are used in solving shift/reduce and
shift/reduce/reduce conflicts. *)
val new_precedence_level: Lexing.position -> Lexing.position -> precedence_level
val new_precedence_level: Lexing.position * Lexing.position -> precedence_level
(* [new_production_level()] creates a new production level, which is stronger
than any levels previously created by this function. It should be called
......
......@@ -103,7 +103,7 @@ declaration:
Positions.mapd (fun nt -> DStart nt, DType ($2, ParameterVar ntloc)) ntloc) $3 }
| priority_keyword symbols
{ let prec = ParserAux.new_precedence_level (rhs_start_pos 1) (rhs_end_pos 1) in
{ let prec = ParserAux.new_precedence_level (rhs_start_pos 1, rhs_end_pos 1) in
List.map (Positions.map (fun symbol -> DTokenProperties (symbol, $1, prec))) $2 }
| PARAMETER OCAMLTYPE
......
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