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

Side by Side Diff: src/preparser.cc

Issue 5295004: Preparser extracted into separate files that can be compiled to a library. (Closed)
Patch Set: Created 10 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (!*ok) return -1; \ 58 if (!*ok) return -1; \
59 ((void)0 59 ((void)0
60 #define DUMMY ) // to make indentation work 60 #define DUMMY ) // to make indentation work
61 #undef DUMMY 61 #undef DUMMY
62 62
63 63
64 void PreParser::ReportUnexpectedToken(i::Token::Value token) { 64 void PreParser::ReportUnexpectedToken(i::Token::Value token) {
65 // We don't report stack overflows here, to avoid increasing the 65 // We don't report stack overflows here, to avoid increasing the
66 // stack depth even further. Instead we report it after parsing is 66 // stack depth even further. Instead we report it after parsing is
67 // over, in ParseProgram. 67 // over, in ParseProgram.
68 if (token == i::Token::ILLEGAL && scanner_->stack_overflow()) { 68 if (token == i::Token::ILLEGAL && stack_overflow_) {
69 return; 69 return;
70 } 70 }
71 i::JavaScriptScanner::Location source_location = scanner_->location(); 71 i::JavaScriptScanner::Location source_location = scanner_->location();
72 72
73 // Four of the tokens are treated specially 73 // Four of the tokens are treated specially
74 switch (token) { 74 switch (token) {
75 case i::Token::EOS: 75 case i::Token::EOS:
76 return ReportMessageAt(source_location.beg_pos, source_location.end_pos, 76 return ReportMessageAt(source_location.beg_pos, source_location.end_pos,
77 "unexpected_eos", NULL); 77 "unexpected_eos", NULL);
78 case i::Token::NUMBER: 78 case i::Token::NUMBER:
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 if (scanner_->literal_length() == 3) { 1175 if (scanner_->literal_length() == 3) {
1176 const char* token = scanner_->literal_string(); 1176 const char* token = scanner_->literal_string();
1177 *is_get = strncmp(token, "get", 3) == 0; 1177 *is_get = strncmp(token, "get", 3) == 0;
1178 *is_set = !*is_get && strncmp(token, "set", 3) == 0; 1178 *is_set = !*is_get && strncmp(token, "set", 3) == 0;
1179 } 1179 }
1180 return GetIdentifierSymbol(); 1180 return GetIdentifierSymbol();
1181 } 1181 }
1182 1182
1183 #undef CHECK_OK 1183 #undef CHECK_OK
1184 } } // v8::preparser 1184 } } // v8::preparser
OLDNEW
« src/preparser.h ('K') | « src/preparser.h ('k') | src/preparser-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698