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

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

Issue 98973003: Experimental scanner: fix starting positions of tokens. (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 | no next file » | 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 : ScannerBase(isolate), 295 : ScannerBase(isolate),
296 source_handle_(source), 296 source_handle_(source),
297 buffer_(NULL), 297 buffer_(NULL),
298 buffer_end_(NULL), 298 buffer_end_(NULL),
299 start_(NULL), 299 start_(NULL),
300 cursor_(NULL), 300 cursor_(NULL),
301 marker_(NULL), 301 marker_(NULL),
302 last_octal_end_(NULL) { 302 last_octal_end_(NULL) {
303 ASSERT(source->IsFlat()); 303 ASSERT(source->IsFlat());
304 SetBufferBasedOnHandle(); 304 SetBufferBasedOnHandle();
305 current_.beg_pos = current_.end_pos = next_.beg_pos = next_.end_pos = 0;
305 } 306 }
306 307
307 virtual void Init() { 308 virtual void Init() {
308 Scan(); 309 Scan();
309 } 310 }
310 311
311 virtual ~ExperimentalScanner() { } 312 virtual ~ExperimentalScanner() { }
312 313
313 virtual void SeekForward(int pos); 314 virtual void SeekForward(int pos);
314 virtual void SetEnd(int pos); 315 virtual void SetEnd(int pos);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // character. 611 // character.
611 const Char* temp_cursor = last_octal_end_ - 1; 612 const Char* temp_cursor = last_octal_end_ - 1;
612 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7') 613 while (temp_cursor >= buffer_ && *temp_cursor >= '0' && *temp_cursor <= '7')
613 --temp_cursor; 614 --temp_cursor;
614 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_); 615 return Location(temp_cursor - buffer_ + 1, last_octal_end_ - buffer_);
615 } 616 }
616 617
617 } } 618 } }
618 619
619 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H 620 #endif // V8_LEXER_EXPERIMENTAL_SCANNER_H
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698