| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 // Determine precedence of given token. | 188 // Determine precedence of given token. |
| 189 static int Precedence(Token::Value token, bool accept_IN) { | 189 static int Precedence(Token::Value token, bool accept_IN) { |
| 190 if (token == Token::IN && !accept_IN) | 190 if (token == Token::IN && !accept_IN) |
| 191 return 0; // 0 precedence will terminate binary expression parsing | 191 return 0; // 0 precedence will terminate binary expression parsing |
| 192 return Token::Precedence(token); | 192 return Token::Precedence(token); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Report syntax errors. | 195 // Report syntax errors. |
| 196 // WTF: changing the signature like this makes it pass |
| 197 //void ReportMessage(const char* message, const Vector<const char*>& args) { |
| 196 void ReportMessage(const char* message, Vector<const char*> args) { | 198 void ReportMessage(const char* message, Vector<const char*> args) { |
| 199 fprintf(stderr, "ParserBase::ReportMessage %s, args len %d\n", message, args
.length()); |
| 200 // WTF: adding this line makes it pass |
| 201 // fprintf(stderr, "args is at %p\n", reinterpret_cast<void*>(&args)); |
| 197 Scanner::Location source_location = scanner()->location(); | 202 Scanner::Location source_location = scanner()->location(); |
| 198 Traits::ReportMessageAt(source_location, message, args); | 203 Traits::ReportMessageAt(source_location, message, args); |
| 204 fprintf(stderr, "ParserBase::ReportMessage returns\n"); |
| 199 } | 205 } |
| 200 | 206 |
| 201 void ReportMessageAt(Scanner::Location location, const char* message) { | 207 void ReportMessageAt(Scanner::Location location, const char* message) { |
| 208 fprintf(stderr, "ParserBase::ReportMessageAt\n"); |
| 202 Traits::ReportMessageAt(location, message, Vector<const char*>::empty()); | 209 Traits::ReportMessageAt(location, message, Vector<const char*>::empty()); |
| 210 fprintf(stderr, "ParserBase::ReportMessageAt returns\n"); |
| 203 } | 211 } |
| 204 | 212 |
| 205 void ReportUnexpectedToken(Token::Value token); | 213 void ReportUnexpectedToken(Token::Value token); |
| 206 | 214 |
| 207 // Recursive descent functions: | 215 // Recursive descent functions: |
| 208 | 216 |
| 209 // Parses an identifier that is valid for the current scope, in particular it | 217 // Parses an identifier that is valid for the current scope, in particular it |
| 210 // fails on strict mode future reserved keywords in a strict scope. If | 218 // fails on strict mode future reserved keywords in a strict scope. If |
| 211 // allow_eval_or_arguments is kAllowEvalOrArguments, we allow "eval" or | 219 // allow_eval_or_arguments is kAllowEvalOrArguments, we allow "eval" or |
| 212 // "arguments" as identifier even in strict mode (this is needed in cases like | 220 // "arguments" as identifier even in strict mode (this is needed in cases like |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 "accessor_get_set"); | 929 "accessor_get_set"); |
| 922 } | 930 } |
| 923 *ok = false; | 931 *ok = false; |
| 924 } | 932 } |
| 925 } | 933 } |
| 926 | 934 |
| 927 | 935 |
| 928 } } // v8::internal | 936 } } // v8::internal |
| 929 | 937 |
| 930 #endif // V8_PREPARSER_H | 938 #endif // V8_PREPARSER_H |
| OLD | NEW |