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

Side by Side Diff: src/preparser.cc

Issue 198713002: move remaining uses of scanner literals into scanner (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/preparser.h ('k') | src/scanner.h » ('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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 bool is_strict_reserved = false; 1157 bool is_strict_reserved = false;
1158 Identifier param_name = 1158 Identifier param_name =
1159 ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK); 1159 ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK);
1160 if (!eval_args_error_loc.IsValid() && param_name.IsEvalOrArguments()) { 1160 if (!eval_args_error_loc.IsValid() && param_name.IsEvalOrArguments()) {
1161 eval_args_error_loc = scanner()->location(); 1161 eval_args_error_loc = scanner()->location();
1162 } 1162 }
1163 if (!reserved_error_loc.IsValid() && is_strict_reserved) { 1163 if (!reserved_error_loc.IsValid() && is_strict_reserved) {
1164 reserved_error_loc = scanner()->location(); 1164 reserved_error_loc = scanner()->location();
1165 } 1165 }
1166 1166
1167 int prev_value; 1167 int prev_value = scanner()->FindSymbol(&duplicate_finder, 1);
1168 if (scanner()->is_literal_one_byte()) {
1169 prev_value = duplicate_finder.AddAsciiSymbol(
1170 scanner()->literal_one_byte_string(), 1);
1171 } else {
1172 prev_value =
1173 duplicate_finder.AddUtf16Symbol(scanner()->literal_utf16_string(), 1);
1174 }
1175 1168
1176 if (!dupe_error_loc.IsValid() && prev_value != 0) { 1169 if (!dupe_error_loc.IsValid() && prev_value != 0) {
1177 dupe_error_loc = scanner()->location(); 1170 dupe_error_loc = scanner()->location();
1178 } 1171 }
1179 1172
1180 done = (peek() == Token::RPAREN); 1173 done = (peek() == Token::RPAREN);
1181 if (!done) { 1174 if (!done) {
1182 Expect(Token::COMMA, CHECK_OK); 1175 Expect(Token::COMMA, CHECK_OK);
1183 } 1176 }
1184 } 1177 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 1259 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
1267 ParseArguments(ok); 1260 ParseArguments(ok);
1268 1261
1269 return Expression::Default(); 1262 return Expression::Default();
1270 } 1263 }
1271 1264
1272 #undef CHECK_OK 1265 #undef CHECK_OK
1273 1266
1274 1267
1275 void PreParser::LogSymbol() { 1268 void PreParser::LogSymbol() {
1276 int identifier_pos = position(); 1269 scanner()->LogSymbol(log_, position());
1277 if (scanner()->is_literal_one_byte()) {
1278 log_->LogAsciiSymbol(identifier_pos, scanner()->literal_one_byte_string());
1279 } else {
1280 log_->LogUtf16Symbol(identifier_pos, scanner()->literal_utf16_string());
1281 }
1282 } 1270 }
1283 1271
1284 1272
1285 } } // v8::internal 1273 } } // v8::internal
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698