OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "../include/v8stdint.h" | 7 #include "../include/v8stdint.h" |
8 | 8 |
9 #include "allocation.h" | 9 #include "allocation.h" |
10 #include "checks.h" | 10 #include "checks.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 } // namespace std | 29 } // namespace std |
30 #endif | 30 #endif |
31 | 31 |
32 namespace v8 { | 32 namespace v8 { |
33 namespace internal { | 33 namespace internal { |
34 | 34 |
35 | 35 |
36 void PreParserTraits::ReportMessageAt(Scanner::Location location, | 36 void PreParserTraits::ReportMessageAt(Scanner::Location location, |
37 const char* message, | 37 const char* message, |
38 Vector<const char*> args, | 38 const char* arg, |
39 bool is_reference_error) { | 39 bool is_reference_error) { |
40 ReportMessageAt(location.beg_pos, | 40 ReportMessageAt(location.beg_pos, |
41 location.end_pos, | 41 location.end_pos, |
42 message, | 42 message, |
43 args.length() > 0 ? args[0] : NULL, | 43 arg, |
44 is_reference_error); | 44 is_reference_error); |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 void PreParserTraits::ReportMessageAt(Scanner::Location location, | |
49 const char* type, | |
50 const char* name_opt, | |
51 bool is_reference_error) { | |
52 pre_parser_->log_->LogMessage(location.beg_pos, location.end_pos, type, | |
53 name_opt, is_reference_error); | |
54 } | |
55 | |
56 | |
57 void PreParserTraits::ReportMessageAt(int start_pos, | 48 void PreParserTraits::ReportMessageAt(int start_pos, |
58 int end_pos, | 49 int end_pos, |
59 const char* type, | 50 const char* message, |
60 const char* name_opt, | 51 const char* arg, |
61 bool is_reference_error) { | 52 bool is_reference_error) { |
62 pre_parser_->log_->LogMessage(start_pos, end_pos, type, name_opt, | 53 pre_parser_->log_->LogMessage(start_pos, end_pos, message, arg, |
63 is_reference_error); | 54 is_reference_error); |
64 } | 55 } |
65 | 56 |
66 | 57 |
67 PreParserIdentifier PreParserTraits::GetSymbol(Scanner* scanner) { | 58 PreParserIdentifier PreParserTraits::GetSymbol(Scanner* scanner) { |
68 if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) { | 59 if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) { |
69 return PreParserIdentifier::FutureReserved(); | 60 return PreParserIdentifier::FutureReserved(); |
70 } else if (scanner->current_token() == | 61 } else if (scanner->current_token() == |
71 Token::FUTURE_STRICT_RESERVED_WORD) { | 62 Token::FUTURE_STRICT_RESERVED_WORD) { |
72 return PreParserIdentifier::FutureStrictReserved(); | 63 return PreParserIdentifier::FutureStrictReserved(); |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); | 923 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); |
933 ParseArguments(ok); | 924 ParseArguments(ok); |
934 | 925 |
935 return Expression::Default(); | 926 return Expression::Default(); |
936 } | 927 } |
937 | 928 |
938 #undef CHECK_OK | 929 #undef CHECK_OK |
939 | 930 |
940 | 931 |
941 } } // v8::internal | 932 } } // v8::internal |
OLD | NEW |