| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 #include <stdint.h> | 64 #include <stdint.h> |
| 65 #include <unistd.h> | 65 #include <unistd.h> |
| 66 | 66 |
| 67 #ifndef O_BINARY | 67 #ifndef O_BINARY |
| 68 #define O_BINARY 0 | 68 #define O_BINARY 0 |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 #endif // defined(WIN32) | 71 #endif // defined(WIN32) |
| 72 | 72 |
| 73 #include "experimental-scanner.h" |
| 73 #include "lexer.h" | 74 #include "lexer.h" |
| 74 | 75 |
| 75 using namespace v8::internal; | 76 using namespace v8::internal; |
| 76 | 77 |
| 77 #define PUSH_TOKEN(T) { send(T); SKIP(); } | 78 #define PUSH_TOKEN(T) { send(T); SKIP(); } |
| 78 #define PUSH_TOKEN_LOOKAHEAD(T) { --cursor_; send(T); SKIP(); } | 79 #define PUSH_TOKEN_LOOKAHEAD(T) { --cursor_; send(T); SKIP(); } |
| 79 #define PUSH_EOF_AND_RETURN() { send(Token::EOS); eof_ = true; return 1;} | 80 #define PUSH_EOF_AND_RETURN() { send(Token::EOS); eof_ = true; return 1;} |
| 80 #define PUSH_LINE_TERMINATOR() { SKIP(); } | 81 #define PUSH_LINE_TERMINATOR() { SKIP(); } |
| 81 #define TERMINATE_ILLEGAL() { send(Token::ILLEGAL); send(Token::EOS); return 1;
} | 82 #define TERMINATE_ILLEGAL() { send(Token::ILLEGAL); send(Token::EOS); return 1;
} |
| 82 | 83 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 size_t start_offset = start_ - buffer_; | 379 size_t start_offset = start_ - buffer_; |
| 379 memmove(buffer_, start_, limit_ - start_); | 380 memmove(buffer_, start_, limit_ - start_); |
| 380 marker_ -= start_offset; | 381 marker_ -= start_offset; |
| 381 cursor_ -= start_offset; | 382 cursor_ -= start_offset; |
| 382 limit_ -= start_offset; | 383 limit_ -= start_offset; |
| 383 start_ -= start_offset; | 384 start_ -= start_offset; |
| 384 real_start_ += start_offset; | 385 real_start_ += start_offset; |
| 385 } | 386 } |
| 386 return 0; | 387 return 0; |
| 387 } | 388 } |
| OLD | NEW |