Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christoph Reichenbach
EDAP15-exercise-3
Commits
3f7d3de8
Commit
3f7d3de8
authored
Dec 04, 2020
by
Noric Couderc
Browse files
Fixed the printing of line locations
Some inconsistencies in how the line numbers were saved.
parent
71383ddf
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/teal0/scanner/scanner.flex
View file @
3f7d3de8
...
...
@@ -40,13 +40,13 @@
{
String text = yytext();
Long data = Long.parseLong(text);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline, yycolumn, yylength(), data);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline
+ 1
, yycolumn
+ 1
, yylength(), data);
}
{HexLiteral}
{
String text = yytext();
Long data = Long.parseLong(text.substring(2), 16);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline, yycolumn, yylength(), data);
return new beaver.Symbol(Terminals.INTEGER_LITERAL, yyline
+ 1
, yycolumn
+ 1
, yylength(), data);
}
{StringLiteral}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment