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

Side by Side Diff: src/scanner.h

Issue 78713002: Experimental lexer generator: generate code for utf-16 character classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Code review (dcarney) Created 7 years, 1 month 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 | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/code_generator.jinja » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 typedef unibrow::Utf8Decoder<512> Utf8Decoder; 132 typedef unibrow::Utf8Decoder<512> Utf8Decoder;
133 133
134 StaticResource<Utf8Decoder>* utf8_decoder() { 134 StaticResource<Utf8Decoder>* utf8_decoder() {
135 return &utf8_decoder_; 135 return &utf8_decoder_;
136 } 136 }
137 137
138 bool IsIdentifierStart(unibrow::uchar c) { return kIsIdentifierStart.get(c); } 138 bool IsIdentifierStart(unibrow::uchar c) { return kIsIdentifierStart.get(c); }
139 bool IsIdentifierPart(unibrow::uchar c) { return kIsIdentifierPart.get(c); } 139 bool IsIdentifierPart(unibrow::uchar c) { return kIsIdentifierPart.get(c); }
140 bool IsLineTerminator(unibrow::uchar c) { return kIsLineTerminator.get(c); } 140 bool IsLineTerminator(unibrow::uchar c) { return kIsLineTerminator.get(c); }
141 bool IsWhiteSpace(unibrow::uchar c) { return kIsWhiteSpace.get(c); } 141 bool IsWhiteSpace(unibrow::uchar c) { return kIsWhiteSpace.get(c); }
142 bool IsLetter(unibrow::uchar c) { return kIsLetter.get(c); }
143 bool IsIdentifierPartNotLetter(unibrow::uchar c) {
144 return kIsIdentifierPartNotLetter.get(c);
145 }
142 146
143 private: 147 private:
144 unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart; 148 unibrow::Predicate<IdentifierStart, 128> kIsIdentifierStart;
145 unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart; 149 unibrow::Predicate<IdentifierPart, 128> kIsIdentifierPart;
146 unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator; 150 unibrow::Predicate<unibrow::LineTerminator, 128> kIsLineTerminator;
147 unibrow::Predicate<unibrow::WhiteSpace, 128> kIsWhiteSpace; 151 unibrow::Predicate<unibrow::WhiteSpace, 128> kIsWhiteSpace;
152 unibrow::Predicate<unibrow::Letter, 128> kIsLetter;
153 unibrow::Predicate<IdentifierPartNotLetter, 128> kIsIdentifierPartNotLetter;
148 StaticResource<Utf8Decoder> utf8_decoder_; 154 StaticResource<Utf8Decoder> utf8_decoder_;
149 155
150 DISALLOW_COPY_AND_ASSIGN(UnicodeCache); 156 DISALLOW_COPY_AND_ASSIGN(UnicodeCache);
151 }; 157 };
152 158
153 159
154 // --------------------------------------------------------------------- 160 // ---------------------------------------------------------------------
155 // DuplicateFinder discovers duplicate symbols. 161 // DuplicateFinder discovers duplicate symbols.
156 162
157 class DuplicateFinder { 163 class DuplicateFinder {
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 bool harmony_scoping_; 621 bool harmony_scoping_;
616 // Whether we scan 'module', 'import', 'export' as keywords. 622 // Whether we scan 'module', 'import', 'export' as keywords.
617 bool harmony_modules_; 623 bool harmony_modules_;
618 // Whether we scan 0o777 and 0b111 as numbers. 624 // Whether we scan 0o777 and 0b111 as numbers.
619 bool harmony_numeric_literals_; 625 bool harmony_numeric_literals_;
620 }; 626 };
621 627
622 } } // namespace v8::internal 628 } } // namespace v8::internal
623 629
624 #endif // V8_SCANNER_H_ 630 #endif // V8_SCANNER_H_
OLDNEW
« no previous file with comments | « src/lexer/lexer_py.re ('k') | tools/lexer_generator/code_generator.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698