Commit 6ac2f8f0 authored by POTTIER Francois's avatar POTTIER Francois

One more test of $symbolstartpos.

parent f92028e0
...@@ -25,7 +25,7 @@ and expr = ...@@ -25,7 +25,7 @@ and expr =
positions * position * int * raw_expr positions * position * int * raw_expr
type main = type main =
positions * nothing * expr positions * nothing * expr * position
let iter f = function let iter f = function
| None -> | None ->
...@@ -96,10 +96,11 @@ module Print = struct ...@@ -96,10 +96,11 @@ module Print = struct
offset "expr: $endofs($0)" ofs; offset "expr: $endofs($0)" ofs;
raw_expr e raw_expr e
let main (poss, n, e) = let main (poss, n, e, pos1) =
positions "main" poss; positions "main" poss;
nothing n; nothing n;
expr e expr e;
position "main: $symbolstartpos" pos1
end end
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
main: main:
| n = nothing e = expr EOL | n = nothing e = expr EOL
{ ($startpos, $endpos), n, e } { ($startpos, $endpos), n, e, $symbolstartpos }
/* Added just to exercise productions with an empty right-hand side. */ /* Added just to exercise productions with an empty right-hand side. */
%inline nothing: %inline nothing:
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
main: main:
| nothing expr EOL | nothing expr EOL
{ (Parsing.rhs_start_pos 1, Parsing.symbol_end_pos()), $1, $2 } { (Parsing.rhs_start_pos 1, Parsing.symbol_end_pos()), $1, $2, Parsing.symbol_start_pos() }
/* Added just to exercise productions with an empty right-hand side. */ /* Added just to exercise productions with an empty right-hand side. */
nothing: nothing:
......
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