| OLD | NEW |
| 1 // Portions of this code based on re2c: | 1 // Portions of this code based on re2c: |
| 2 // (re2c/examples/push.re) | 2 // (re2c/examples/push.re) |
| 3 // Copyright 2013 the V8 project authors. All rights reserved. | 3 // Copyright 2013 the V8 project authors. All rights reserved. |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 | 319 |
| 320 <Normal> identifier_start_ :=> Identifier | 320 <Normal> identifier_start_ :=> Identifier |
| 321 | 321 |
| 322 <Normal> eof { PUSH_EOF_AND_RETURN();} | 322 <Normal> eof { PUSH_EOF_AND_RETURN();} |
| 323 <Normal> any { PUSH_TOKEN(Token::ILLEGAL); } | 323 <Normal> any { PUSH_TOKEN(Token::ILLEGAL); } |
| 324 | 324 |
| 325 <DoubleQuoteString> "\\\"" { goto yy0; } | 325 <DoubleQuoteString> "\\\"" { goto yy0; } |
| 326 <DoubleQuoteString> '"' { PUSH_TOKEN(Token::STRING);} | 326 <DoubleQuoteString> '"' { PUSH_TOKEN(Token::STRING);} |
| 327 <DoubleQuoteString> "\\" "\n" "\r"? { goto yy0; } | 327 <DoubleQuoteString> "\\" "\n" "\r"? { goto yy0; } |
| 328 <DoubleQuoteString> "\\" "\r" "\n"? { goto yy0; } | 328 <DoubleQuoteString> "\\" "\r" "\n"? { goto yy0; } |
| 329 <DoubleQuoteString> line_terminator { TERMINATE_ILLEGAL(); } | 329 <DoubleQuoteString> "\n" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL)
; } |
| 330 <DoubleQuoteString> "\r" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL)
; } |
| 330 <DoubleQuoteString> eof { TERMINATE_ILLEGAL(); } | 331 <DoubleQuoteString> eof { TERMINATE_ILLEGAL(); } |
| 331 <DoubleQuoteString> any { goto yy0; } | 332 <DoubleQuoteString> any { goto yy0; } |
| 332 | 333 |
| 333 <SingleQuoteString> "\\'" { goto yy0; } | 334 <SingleQuoteString> "\\'" { goto yy0; } |
| 334 <SingleQuoteString> "'" { PUSH_TOKEN(Token::STRING);} | 335 <SingleQuoteString> "'" { PUSH_TOKEN(Token::STRING);} |
| 335 <SingleQuoteString> "\\" "\n" "\r"? { goto yy0; } | 336 <SingleQuoteString> "\\" "\n" "\r"? { goto yy0; } |
| 336 <SingleQuoteString> "\\" "\r" "\n"? { goto yy0; } | 337 <SingleQuoteString> "\\" "\r" "\n"? { goto yy0; } |
| 337 <SingleQuoteString> line_terminator { TERMINATE_ILLEGAL(); } | 338 <SingleQuoteString> "\n" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL)
; } |
| 339 <SingleQuoteString> "\r" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL)
; } |
| 338 <SingleQuoteString> eof { TERMINATE_ILLEGAL(); } | 340 <SingleQuoteString> eof { TERMINATE_ILLEGAL(); } |
| 339 <SingleQuoteString> any { goto yy0; } | 341 <SingleQuoteString> any { goto yy0; } |
| 340 | 342 |
| 341 <Identifier> identifier_char+ { goto yy0; } | 343 <Identifier> identifier_char+ { goto yy0; } |
| 342 <Identifier> illegal_after_identifier { PUSH_TOKEN(Token::ILLEGAL); } | 344 <Identifier> illegal_after_identifier { PUSH_TOKEN(Token::ILLEGAL); } |
| 343 <Identifier> any { PUSH_TOKEN_LOOKAHEAD(Token::IDENTIFIER); } | 345 <Identifier> any { PUSH_TOKEN_LOOKAHEAD(Token::IDENTIFIER); } |
| 344 | 346 |
| 345 <SingleLineComment> line_terminator { PUSH_LINE_TERMINATOR();} | 347 <SingleLineComment> line_terminator { PUSH_LINE_TERMINATOR();} |
| 346 <SingleLineComment> eof { PUSH_LINE_TERMINATOR();} | 348 <SingleLineComment> eof { PUSH_LINE_TERMINATOR();} |
| 347 <SingleLineComment> any { goto yy0; } | 349 <SingleLineComment> any { goto yy0; } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 size_t start_offset = start_ - buffer_; | 383 size_t start_offset = start_ - buffer_; |
| 382 memmove(buffer_, start_, limit_ - start_); | 384 memmove(buffer_, start_, limit_ - start_); |
| 383 marker_ -= start_offset; | 385 marker_ -= start_offset; |
| 384 cursor_ -= start_offset; | 386 cursor_ -= start_offset; |
| 385 limit_ -= start_offset; | 387 limit_ -= start_offset; |
| 386 start_ -= start_offset; | 388 start_ -= start_offset; |
| 387 real_start_ += start_offset; | 389 real_start_ += start_offset; |
| 388 } | 390 } |
| 389 return 0; | 391 return 0; |
| 390 } | 392 } |
| OLD | NEW |