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

Side by Side Diff: src/lexer/experimental-scanner.h

Issue 91123002: Experimental scanner: keep track of which strings / identifiers contain an escape. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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 | « no previous file | src/lexer/lexer_py.re » ('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 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 void clear_octal_position() { } // FIXME 182 void clear_octal_position() { } // FIXME
183 183
184 // Seek forward to the given position. This operation works for simple cases 184 // Seek forward to the given position. This operation works for simple cases
185 // such as seeking forward until simple delimiter tokens, which is what it is 185 // such as seeking forward until simple delimiter tokens, which is what it is
186 // used for. After this call, we will have the token at the given position as 186 // used for. After this call, we will have the token at the given position as
187 // the "next" token. The "current" token will be invalid. FIXME: for utf-8, 187 // the "next" token. The "current" token will be invalid. FIXME: for utf-8,
188 // we need to decide if pos is counted in characters or in bytes. 188 // we need to decide if pos is counted in characters or in bytes.
189 virtual void SeekForward(int pos) = 0; 189 virtual void SeekForward(int pos) = 0;
190 190
191 // Scans the input as a regular expression pattern, previous 191 // Scans the input as a regular expression pattern, previous character(s) must
192 // character(s) must be /(=). Returns true if a pattern is scanned. 192 // be /(=). Returns true if a pattern is scanned. FIXME: this won't work for
193 // utf-8 newlines.
193 virtual bool ScanRegExpPattern(bool seen_equal) = 0; 194 virtual bool ScanRegExpPattern(bool seen_equal) = 0;
194 // Returns true if regexp flags are scanned (always since flags can 195 // Returns true if regexp flags are scanned (always since flags can
195 // be empty). 196 // be empty).
196 virtual bool ScanRegExpFlags() = 0; 197 virtual bool ScanRegExpFlags() = 0;
197 198
198 protected: 199 protected:
199 struct TokenDesc { 200 struct TokenDesc {
200 Token::Value token; 201 Token::Value token;
201 int beg_pos; 202 int beg_pos;
202 int end_pos; 203 int end_pos;
204 bool has_escapes;
203 }; 205 };
204 206
205 virtual void Scan() = 0; 207 virtual void Scan() = 0;
206 virtual void SetBufferBasedOnHandle() = 0; 208 virtual void SetBufferBasedOnHandle() = 0;
207 209
208 static void UpdateBuffersAfterGC(v8::Isolate*, GCType, GCCallbackFlags); 210 static void UpdateBuffersAfterGC(v8::Isolate*, GCType, GCCallbackFlags);
209 211
210 Isolate* isolate_; 212 Isolate* isolate_;
211 UnicodeCache* unicode_cache_; 213 UnicodeCache* unicode_cache_;
212 214
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 i++; 391 i++;
390 } 392 }
391 } 393 }
392 return i == 6; 394 return i == 6;
393 } 395 }
394 396
395 397
396 } } 398 } }
397 399
398 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H 400 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H
OLDNEW
« no previous file with comments | « no previous file | src/lexer/lexer_py.re » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698