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

Side by Side Diff: src/scanner-base.cc

Issue 7232010: Version 3.4.6 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 9 years, 6 months 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/scanner-base.h ('k') | src/version.cc » ('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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 71
72 72
73 // ---------------------------------------------------------------------------- 73 // ----------------------------------------------------------------------------
74 // JavaScriptScanner 74 // JavaScriptScanner
75 75
76 JavaScriptScanner::JavaScriptScanner(UnicodeCache* scanner_contants) 76 JavaScriptScanner::JavaScriptScanner(UnicodeCache* scanner_contants)
77 : Scanner(scanner_contants), octal_pos_(Location::invalid()) { } 77 : Scanner(scanner_contants), octal_pos_(Location::invalid()) { }
78 78
79 79
80 void JavaScriptScanner::Initialize(UC16CharacterStream* source) {
81 source_ = source;
82 // Need to capture identifiers in order to recognize "get" and "set"
83 // in object literals.
84 Init();
85 // Skip initial whitespace allowing HTML comment ends just like
86 // after a newline and scan first token.
87 has_line_terminator_before_next_ = true;
88 SkipWhiteSpace();
89 Scan();
90 }
91
80 Token::Value JavaScriptScanner::Next() { 92 Token::Value JavaScriptScanner::Next() {
81 current_ = next_; 93 current_ = next_;
82 has_line_terminator_before_next_ = false; 94 has_line_terminator_before_next_ = false;
83 has_multiline_comment_before_next_ = false; 95 has_multiline_comment_before_next_ = false;
84 Scan(); 96 Scan();
85 return current_.token; 97 return current_.token;
86 } 98 }
87 99
88 100
89 static inline bool IsByteOrderMark(uc32 c) { 101 static inline bool IsByteOrderMark(uc32 c) {
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return; 957 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return;
946 break; 958 break;
947 case UNMATCHABLE: 959 case UNMATCHABLE:
948 break; 960 break;
949 } 961 }
950 // On fallthrough, it's a failure. 962 // On fallthrough, it's a failure.
951 state_ = UNMATCHABLE; 963 state_ = UNMATCHABLE;
952 } 964 }
953 965
954 } } // namespace v8::internal 966 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner-base.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698