Commit 248ea86f authored by POTTIER Francois's avatar POTTIER Francois
Browse files

New examples and expected output.

parent 103e44ef
File "symbolstartpos-with-param.mly", line 4, characters 12-31:
Error: $symbolstartpos does not take a parameter.
%token A B
%start<unit> main
%%
main: A B { $symbolstartpos($2) }
%token A B
%start<unit> main
%%
main: A B { $symbolstartofs }
%start main
%token B
%token A
%type <unit> main
%%
main:
| _1 = A _2 = B
{let _endpos = _endpos__2_ in
let _symbolstartpos = if Pervasives.(!=) _startpos__1_ _endpos__1_ then
_startpos__1_
else
if Pervasives.(!=) _startpos__2_ _endpos__2_ then
_startpos__2_
else
_endpos in
let _symbolstartofs = _symbolstartpos.Lexing.pos_cnum in
( _symbolstartofs )}
%%
%token A B
%start<unit> main
%%
main: A B { $symbolstartpos, $symbolstartofs }
%start main
%token B
%token A
%type <unit> main
%%
main:
| _1 = A _2 = B
{let _endpos = _endpos__2_ in
let _symbolstartpos = if Pervasives.(!=) _startpos__1_ _endpos__1_ then
_startpos__1_
else
if Pervasives.(!=) _startpos__2_ _endpos__2_ then
_startpos__2_
else
_endpos in
let _symbolstartofs = _symbolstartpos.Lexing.pos_cnum in
( _symbolstartpos, _symbolstartofs )}
%%
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