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

Side by Side Diff: src/scanner.h

Issue 4135004: Separate JSON parsing from the JavaScript parser. (Closed)
Patch Set: Rename GetSymbol. Move ZoneScope. Created 10 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
« no previous file with comments | « src/runtime.cc ('k') | src/v8natives.js » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 void Initialize(Handle<String> source, 289 void Initialize(Handle<String> source,
290 unibrow::CharacterStream* stream, 290 unibrow::CharacterStream* stream,
291 ParserLanguage language); 291 ParserLanguage language);
292 void Initialize(Handle<String> source, 292 void Initialize(Handle<String> source,
293 int start_position, int end_position, 293 int start_position, int end_position,
294 ParserLanguage language); 294 ParserLanguage language);
295 295
296 // Returns the next token. 296 // Returns the next token.
297 Token::Value Next(); 297 Token::Value Next();
298 298
299 // Returns the current token again.
300 Token::Value current_token() { return current_.token; }
301
299 // One token look-ahead (past the token returned by Next()). 302 // One token look-ahead (past the token returned by Next()).
300 Token::Value peek() const { return next_.token; } 303 Token::Value peek() const { return next_.token; }
301 304
302 // Returns true if there was a line terminator before the peek'ed token. 305 // Returns true if there was a line terminator before the peek'ed token.
303 bool has_line_terminator_before_next() const { 306 bool has_line_terminator_before_next() const {
304 return has_line_terminator_before_next_; 307 return has_line_terminator_before_next_;
305 } 308 }
306 309
307 struct Location { 310 struct Location {
308 Location(int b, int e) : beg_pos(b), end_pos(e) { } 311 Location(int b, int e) : beg_pos(b), end_pos(e) { }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 bool stack_overflow_; 513 bool stack_overflow_;
511 static StaticResource<Utf8Decoder> utf8_decoder_; 514 static StaticResource<Utf8Decoder> utf8_decoder_;
512 515
513 // One Unicode character look-ahead; c0_ < 0 at the end of the input. 516 // One Unicode character look-ahead; c0_ < 0 at the end of the input.
514 uc32 c0_; 517 uc32 c0_;
515 }; 518 };
516 519
517 } } // namespace v8::internal 520 } } // namespace v8::internal
518 521
519 #endif // V8_SCANNER_H_ 522 #endif // V8_SCANNER_H_
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698