Commit ff6a0a5c by alokp@chromium.org

Fixed line number reporting. Each newline was being counted twice.

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1015 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 3f990c4a
......@@ -32,6 +32,7 @@ typedef pp::Token::Location YYLTYPE;
#define YY_USER_ACTION \
do { \
yylloc->line = yylineno; \
yylloc->string = 0; \
} while(0);
#define YY_INPUT(buf, result, maxSize) \
......@@ -100,15 +101,10 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".")
"|=" { return pp::Token::OP_OR_ASSIGN; }
{PUNCTUATOR} { return yytext[0]; }
[ \t\v\f]+ { /* Ignore whitespace */ }
\n { return yytext[0]; }
[ \t\v\f]+ { /* Ignore whitespace */ }
\n {
++yylineno; yycolumn = 0;
return yytext[0];
}
<*><<EOF>> { yyterminate(); }
<*><<EOF>> { yyterminate(); }
%%
......
#line 16 "./src/compiler/preprocessor/new/pp.l"
#line 16 "./pp.l"
//
// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
......@@ -9,7 +9,7 @@
#line 13 "./src/compiler/preprocessor/new/pp_lex.cpp"
#line 13 "./pp_lex.cpp"
#define YY_INT_ALIGNED short int
......@@ -524,6 +524,7 @@ typedef pp::Token::Location YYLTYPE;
#define YY_USER_ACTION \
do { \
yylloc->line = yylineno; \
yylloc->string = 0; \
} while(0);
#define YY_INPUT(buf, result, maxSize) \
......@@ -973,10 +974,7 @@ YY_RULE_SETUP
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
{
++yylineno; yycolumn = 0;
return yytext[0];
}
{ return yytext[0]; }
YY_BREAK
case YY_STATE_EOF(INITIAL):
{ yyterminate(); }
......
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