Commit 6636a4a7 authored by POTTIER Francois's avatar POTTIER Francois

Rename [Positions.lex_join] to [Positions.import]. Change its API. Use [$loc].

parent f7876493
...@@ -271,7 +271,7 @@ production: ...@@ -271,7 +271,7 @@ production:
{ producers, { producers,
oprec, oprec,
ParserAux.new_production_level(), ParserAux.new_production_level(),
Positions.lex_join $startpos $endpos Positions.import $loc
} }
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
......
...@@ -461,7 +461,7 @@ rule main = parse ...@@ -461,7 +461,7 @@ rule main = parse
{ let openingpos = lexeme_start_p lexbuf in { let openingpos = lexeme_start_p lexbuf in
let stretchpos = lexeme_end_p lexbuf in let stretchpos = lexeme_end_p lexbuf in
let closingpos = attribute openingpos lexbuf in let closingpos = attribute openingpos lexbuf in
let pos = Positions.lex_join openingpos (lexeme_end_p lexbuf) in let pos = Positions.import (openingpos, lexeme_end_p lexbuf) in
let attr = mk_stretch stretchpos closingpos false [] in let attr = mk_stretch stretchpos closingpos false [] in
if percent = "" then if percent = "" then
(* No [%] sign: this is a normal attribute. *) (* No [%] sign: this is a normal attribute. *)
......
...@@ -86,8 +86,8 @@ let join x1 x2 = ...@@ -86,8 +86,8 @@ let join x1 x2 =
end_of_position (if x2 = dummy then x1 else x2) end_of_position (if x2 = dummy then x1 else x2)
) )
let lex_join x1 x2 = let import x =
(x1, x2) x
let join_located l1 l2 f = let join_located l1 l2 f =
{ {
...@@ -138,13 +138,13 @@ type positions = ...@@ -138,13 +138,13 @@ type positions =
t list t list
let one (pos : position) : positions = let one (pos : position) : positions =
[ (pos, pos) ] (* or: lex_join pos pos *) [ import (pos, pos) ]
let two (pos1 : position) (pos2 : position) : positions = let two (pos1 : position) (pos2 : position) : positions =
[ lex_join pos1 pos2 ] [ import (pos1, pos2) ]
let lexbuf (lexbuf : lexbuf) : positions = let lexbuf (lexbuf : lexbuf) : positions =
[ lex_join lexbuf.lex_start_p lexbuf.lex_curr_p ] [ import (lexbuf.lex_start_p, lexbuf.lex_curr_p) ]
let print (pos : position) = let print (pos : position) =
Printf.printf Printf.printf
......
...@@ -82,7 +82,7 @@ val filename_of_position: t -> string ...@@ -82,7 +82,7 @@ val filename_of_position: t -> string
starts and stops where [p2] stops. *) starts and stops where [p2] stops. *)
val join : t -> t -> t val join : t -> t -> t
val lex_join : Lexing.position -> Lexing.position -> t val import : Lexing.position * Lexing.position -> t
val ljoinf : ('a -> t) -> 'a list -> t val ljoinf : ('a -> t) -> 'a list -> t
......
...@@ -346,7 +346,7 @@ production: ...@@ -346,7 +346,7 @@ production:
{ List.rev $1, { List.rev $1,
$2, $2,
ParserAux.new_production_level(), ParserAux.new_production_level(),
Positions.lex_join (symbol_start_pos()) (symbol_end_pos()) Positions.import (symbol_start_pos(), symbol_end_pos())
} }
producers: producers:
...@@ -361,8 +361,8 @@ producers: ...@@ -361,8 +361,8 @@ producers:
producer: producer:
| actual attributes | actual attributes
{ Positions.lex_join (symbol_start_pos()) (symbol_end_pos()), None, $1, $2 } { Positions.import (symbol_start_pos(), symbol_end_pos()), None, $1, $2 }
| LID EQUAL actual attributes | LID EQUAL actual attributes
{ Positions.lex_join (symbol_start_pos()) (symbol_end_pos()), Some $1, $3, $4 } { Positions.import (symbol_start_pos(), symbol_end_pos()), Some $1, $3, $4 }
%% %%
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