diff options
author | Alex Merry <dev@randomguy3.me.uk> | 2013-03-23 23:24:06 +0000 |
---|---|---|
committer | Alex Merry <dev@randomguy3.me.uk> | 2013-03-23 23:24:06 +0000 |
commit | b31704494636c71894ec8850c570056d0b8b9bac (patch) | |
tree | ec2d10c95e88555c07529e260de338e82ea55136 /tikzit/src/common/tikzlexer.lm | |
parent | 5f4cb99c6b358e2e554e516eaf0ecc6ea6f8690d (diff) |
Fixes to the parser error-reporting code
Diffstat (limited to 'tikzit/src/common/tikzlexer.lm')
-rw-r--r-- | tikzit/src/common/tikzlexer.lm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tikzit/src/common/tikzlexer.lm b/tikzit/src/common/tikzlexer.lm index 0785c17..4e675ad 100644 --- a/tikzit/src/common/tikzlexer.lm +++ b/tikzit/src/common/tikzlexer.lm @@ -24,9 +24,8 @@ #define YY_USER_ACTION \ yylloc->first_line = yylloc->last_line; \ - if (yylloc->last_line != 1 || yylloc->last_column != 1) \ - yylloc->first_column = yylloc->last_column + 1; \ - yylloc->last_column = yylloc->first_column + yyleng; + yylloc->first_column = yylloc->last_column + 1; \ + yylloc->last_column = yylloc->first_column + yyleng - 1; %} @@ -54,7 +53,7 @@ FLOAT \-?[0-9]*(\.[0-9]+)? <INITIAL,xcoord,ycoord,props,noderef>[\t]+ { // tab = 8 columns // note that we have already adjusted by yyleng at this point - yylloc->last_column = yylloc->first_column + 7*yyleng; + yylloc->last_column += 7*yyleng; } \\begin\{tikzpicture\} { return BEGIN_TIKZPICTURE_CMD; } \\end\{tikzpicture\} { return END_TIKZPICTURE_CMD; } |