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

One more test of $symbolstartpos.

parent f92028e0
......@@ -25,7 +25,7 @@ and expr =
positions * position * int * raw_expr
type main =
positions * nothing * expr
positions * nothing * expr * position
let iter f = function
| None ->
......@@ -96,10 +96,11 @@ module Print = struct
offset "expr: $endofs($0)" ofs;
raw_expr e
let main (poss, n, e) =
let main (poss, n, e, pos1) =
positions "main" poss;
nothing n;
expr e
expr e;
position "main: $symbolstartpos" pos1
end
......@@ -17,7 +17,7 @@
main:
| 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. */
%inline nothing:
......
......@@ -24,7 +24,7 @@
main:
| 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. */
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