OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #ifndef V8_LEXER_EVEN_MORE_EXPERIMENTAL_SCANNER_H | 28 #ifndef V8_LEXER_EVEN_MORE_EXPERIMENTAL_SCANNER_H |
29 #define V8_LEXER_EVEN_MORE_EXPERIMENTAL_SCANNER_H | 29 #define V8_LEXER_EVEN_MORE_EXPERIMENTAL_SCANNER_H |
30 | 30 |
31 #include "token.h" | 31 #include "token.h" |
32 #include "flags.h" | 32 #include "flags.h" |
33 #include "v8stdint.h" | 33 #include "v8stdint.h" |
34 | 34 |
35 #define YYCTYPE uint8_t | 35 #define YYCTYPE uint8_t |
36 | 36 |
37 #define PUSH_TOKEN(T) { send(T); start_ = cursor_; } | 37 #define PUSH_TOKEN(T) { \ |
38 #define PUSH_LINE_TERMINATOR(s) { start_ = cursor_; } | 38 send(T); \ |
39 #define FORWARD() { yych = *(++cursor_); } | 39 start_ = cursor_; \ |
40 #define SKIP() { start_ = cursor_; } | 40 just_seen_line_terminator_ = false; \ |
| 41 } |
| 42 #define PUSH_LINE_TERMINATOR(s) { \ |
| 43 start_ = cursor_; \ |
| 44 just_seen_line_terminator_ = true; \ |
| 45 } |
| 46 #define FORWARD() { \ |
| 47 yych = *(++cursor_); \ |
| 48 } |
| 49 #define SKIP() { \ |
| 50 start_ = cursor_; \ |
| 51 } |
41 | 52 |
42 namespace v8 { | 53 namespace v8 { |
43 namespace internal { | 54 namespace internal { |
44 | 55 |
45 class ExperimentalScanner; | 56 class ExperimentalScanner; |
46 class UnicodeCache; | 57 class UnicodeCache; |
47 | 58 |
48 class EvenMoreExperimentalScanner { | 59 class EvenMoreExperimentalScanner { |
49 public: | 60 public: |
50 explicit EvenMoreExperimentalScanner(ExperimentalScanner* sink, | 61 explicit EvenMoreExperimentalScanner(ExperimentalScanner* sink, |
(...skipping 10 matching lines...) Expand all Loading... |
61 bool ValidIdentifierStart(); | 72 bool ValidIdentifierStart(); |
62 bool ValidIdentifierPart(); | 73 bool ValidIdentifierPart(); |
63 uc32 ScanHexNumber(int length); | 74 uc32 ScanHexNumber(int length); |
64 | 75 |
65 UnicodeCache* unicode_cache_; | 76 UnicodeCache* unicode_cache_; |
66 | 77 |
67 YYCTYPE* buffer_; | 78 YYCTYPE* buffer_; |
68 YYCTYPE* buffer_end_; | 79 YYCTYPE* buffer_end_; |
69 YYCTYPE* start_; | 80 YYCTYPE* start_; |
70 YYCTYPE* cursor_; | 81 YYCTYPE* cursor_; |
| 82 bool just_seen_line_terminator_; |
71 | 83 |
72 YYCTYPE yych; | 84 YYCTYPE yych; |
73 ExperimentalScanner* sink_; | 85 ExperimentalScanner* sink_; |
74 }; | 86 }; |
75 | 87 |
76 } } | 88 } } |
77 | 89 |
78 #endif // V8_LEXER_LEXER_H | 90 #endif // V8_LEXER_LEXER_H |
OLD | NEW |