Skip to content

Commit

Permalink
Work on lexeme priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrey Kegler committed Apr 2, 2013
1 parent 20db22e commit 8145ae5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion r2/t/sl_calc.t
Expand Up @@ -128,7 +128,7 @@ my $grammar2 = Marpa::R2::Scanless::G->new(
statement ::= (<say keyword>) expression | expression
expression ::=
number bless => primary
variable bless => primary
| variable bless => primary
|| Expression ('+') Expression bless => add
number ~ [\d]+
variable ~ [[:alpha:]] <optional word characters>
Expand Down
4 changes: 2 additions & 2 deletions r2/xs/R2.xs
Expand Up @@ -5416,14 +5416,14 @@ PPCODE:
croak ("Problem in slr->line_column(%ld): position out of range",
(long) pos);
}
linecol = stream->pos_db[stream->pos_db_logical_size].linecol;
linecol = stream->pos_db[pos].linecol;
if (linecol >= 0)
{ /* Zero should not happen */
line = linecol;
}
else
{
line = stream->pos_db[stream->pos_db_logical_size + linecol].linecol;
line = stream->pos_db[pos + linecol].linecol;
column = -linecol + 1;
}
XPUSHs (sv_2mortal (newSViv ((IV) line)));
Expand Down

0 comments on commit 8145ae5

Please sign in to comment.