Commit d08bb0cc by alokp@chromium.org

The default implementation in flex only handles LF characters. GLSL supports all…

The default implementation in flex only handles LF characters. GLSL supports all three newline characters - LF, CR, and CR+LF. Use a custom newline handler. Review URL: https://codereview.appspot.com/6105045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@1049 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 036a7356
...@@ -43,10 +43,11 @@ static int readInput(char* buf, int maxSize, yyscan_t scanner); ...@@ -43,10 +43,11 @@ static int readInput(char* buf, int maxSize, yyscan_t scanner);
%} %}
%option noyywrap nounput never-interactive %option noyywrap nounput never-interactive
%option yylineno reentrant bison-bridge bison-locations %option reentrant bison-bridge bison-locations
%option prefix="pp" %option prefix="pp"
%option extra-type="pp::Input*" %option extra-type="pp::Input*"
NEWLINE "\n"|"\r"|"\r\n"
IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]* IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]*
PUNCTUATOR [][<>(){}.+-/*%^|&~=!:;,?] PUNCTUATOR [][<>(){}.+-/*%^|&~=!:;,?]
...@@ -108,7 +109,11 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".") ...@@ -108,7 +109,11 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".")
{PUNCTUATOR} { return yytext[0]; } {PUNCTUATOR} { return yytext[0]; }
[ \t\v\f]+ { return ' '; } [ \t\v\f]+ { return ' '; }
\n { return yytext[0]; }
{NEWLINE} {
++yylineno;
return '\n';
}
. { . {
yylval->push_back(yytext[0]); yylval->push_back(yytext[0]);
......
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