Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 // JavaScript scanner getting its input from either a V8 String or a unicode | 101 // JavaScript scanner getting its input from either a V8 String or a unicode |
| 102 // CharacterStream. | 102 // CharacterStream. |
| 103 | 103 |
| 104 class V8JavaScriptScanner : public JavaScriptScanner { | 104 class V8JavaScriptScanner : public JavaScriptScanner { |
| 105 public: | 105 public: |
| 106 V8JavaScriptScanner() {} | 106 V8JavaScriptScanner() {} |
| 107 | 107 |
| 108 Token::Value NextCheckStack(); | 108 Token::Value NextCheckStack(); |
| 109 | 109 |
| 110 // Initialize the Scanner to scan source. | 110 // Initialize the Scanner to scan source. |
| 111 void Initialize(Handle<String> source); | 111 void Initialize(Handle<String> source, int literal_flags = kAllLiteralsFlag); |
| 112 void Initialize(Handle<String> source, | 112 void Initialize(Handle<String> source, |
| 113 unibrow::CharacterStream* stream); | 113 unibrow::CharacterStream* stream, |
| 114 int literal_flags = kAllLiteralsFlag); | |
| 114 void Initialize(Handle<String> source, | 115 void Initialize(Handle<String> source, |
| 115 int start_position, int end_position); | 116 int start_position, int end_position, |
| 117 int literal_flags = kAllLiteralsFlag); | |
| 116 | 118 |
| 117 protected: | 119 protected: |
| 120 static const int kAllLiteralsFlag = kLiteralNumber | kLiteralString | |
|
Søren Thygesen Gjesse
2010/11/19 08:17:21
This constant should also be in the enum.
Lasse Reichstein
2010/11/19 08:51:24
Done.
| |
| 121 | kLiteralIdentifier | kLiteralRegExp | kLiteralRegExpFlags; | |
| 118 StreamInitializer stream_initializer_; | 122 StreamInitializer stream_initializer_; |
| 119 }; | 123 }; |
| 120 | 124 |
| 121 | 125 |
| 122 class JsonScanner : public Scanner { | 126 class JsonScanner : public Scanner { |
| 123 public: | 127 public: |
| 124 JsonScanner(); | 128 JsonScanner(); |
| 125 | 129 |
| 126 // Initialize the Scanner to scan source. | 130 // Initialize the Scanner to scan source. |
| 127 void Initialize(Handle<String> source); | 131 void Initialize(Handle<String> source); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 | 213 |
| 210 | 214 |
| 211 template <typename StringType, typename CharType> | 215 template <typename StringType, typename CharType> |
| 212 void ExternalStringUTF16Buffer<StringType, CharType>::SeekForward(int pos) { | 216 void ExternalStringUTF16Buffer<StringType, CharType>::SeekForward(int pos) { |
| 213 pos_ = pos; | 217 pos_ = pos; |
| 214 } | 218 } |
| 215 | 219 |
| 216 } } // namespace v8::internal | 220 } } // namespace v8::internal |
| 217 | 221 |
| 218 #endif // V8_SCANNER_H_ | 222 #endif // V8_SCANNER_H_ |
| OLD | NEW |