| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |