Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/lexer/lexer.re

Issue 26183005: Experimental push model parser: Regexp fix. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <fcntl.h> 1 #include <fcntl.h>
2 #include <stdio.h> 2 #include <stdio.h>
3 #include <stddef.h> 3 #include <stddef.h>
4 #include <stdlib.h> 4 #include <stdlib.h>
5 #include <string.h> 5 #include <string.h>
6 6
7 // TODO: 7 // TODO:
8 // - SpiderMonkey compatibility hack: " --> something" is treated 8 // - SpiderMonkey compatibility hack: " --> something" is treated
9 // as a single line comment. 9 // as a single line comment.
10 // - An identifier cannot start immediately after a number. 10 // - An identifier cannot start immediately after a number.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 /*!re2c 162 /*!re2c
163 re2c:indent:top = 1; 163 re2c:indent:top = 1;
164 re2c:yych:conversion = 0; 164 re2c:yych:conversion = 0;
165 re2c:condenumprefix = kCondition; 165 re2c:condenumprefix = kCondition;
166 re2c:define:YYCONDTYPE = Condition; 166 re2c:define:YYCONDTYPE = Condition;
167 167
168 eof = "\000"; 168 eof = "\000";
169 any = [\000-\377]; 169 any = [\000-\377];
170 whitespace_char = [ \t\v\f\r]; 170 whitespace_char = [ \t\v\f\r];
171 whitespace = whitespace_char+; 171 whitespace = whitespace_char+;
172 identifier_start_ = [$_\\a-zA-z]; 172 identifier_start_ = [$_\\a-zA-Z];
173 identifier_char = [$_\\a-zA-z0-9]; 173 identifier_char = [$_\\a-zA-Z0-9];
174 line_terminator = [\n\r]+; 174 line_terminator = [\n\r]+;
175 digit = [0-9]; 175 digit = [0-9];
176 hex_digit = [0-9a-fA-F]; 176 hex_digit = [0-9a-fA-F];
177 maybe_exponent = ('e' [-+]? digit+)?; 177 maybe_exponent = ('e' [-+]? digit+)?;
178 178
179 <Normal> "break" { PUSH_TOKEN(Token::BREAK); } 179 <Normal> "break" { PUSH_TOKEN(Token::BREAK); }
180 <Normal> "case" { PUSH_TOKEN(Token::CASE); } 180 <Normal> "case" { PUSH_TOKEN(Token::CASE); }
181 <Normal> "catch" { PUSH_TOKEN(Token::CATCH); } 181 <Normal> "catch" { PUSH_TOKEN(Token::CATCH); }
182 <Normal> "class" { PUSH_TOKEN(Token::FUTURE_RESERVED_WORD); } 182 <Normal> "class" { PUSH_TOKEN(Token::FUTURE_RESERVED_WORD); }
183 <Normal> "const" { PUSH_TOKEN(Token::CONST); } 183 <Normal> "const" { PUSH_TOKEN(Token::CONST); }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 413
414 void ExperimentalScanner::Record(Token::Value token, int beg, int end) { 414 void ExperimentalScanner::Record(Token::Value token, int beg, int end) {
415 if (token == Token::EOS) end--; 415 if (token == Token::EOS) end--;
416 token_[fetched_] = token; 416 token_[fetched_] = token;
417 beg_[fetched_] = beg; 417 beg_[fetched_] = beg;
418 end_[fetched_] = end; 418 end_[fetched_] = end;
419 fetched_++; 419 fetched_++;
420 } 420 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698