OLD | NEW |
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 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "scanner-character-streams.h" | 30 #include "scanner-character-streams.h" |
31 | 31 |
32 #include "ast.h" | |
33 #include "handles.h" | 32 #include "handles.h" |
34 #include "unicode-inl.h" | 33 #include "unicode-inl.h" |
35 | 34 |
36 namespace v8 { | 35 namespace v8 { |
37 namespace internal { | 36 namespace internal { |
38 | 37 |
39 // ---------------------------------------------------------------------------- | 38 // ---------------------------------------------------------------------------- |
40 // BufferedUC16CharacterStreams | 39 // BufferedUC16CharacterStreams |
41 | 40 |
42 BufferedUC16CharacterStream::BufferedUC16CharacterStream() | 41 BufferedUC16CharacterStream::BufferedUC16CharacterStream() |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 int start_position, | 297 int start_position, |
299 int end_position) | 298 int end_position) |
300 : UC16CharacterStream(), | 299 : UC16CharacterStream(), |
301 source_(data), | 300 source_(data), |
302 raw_data_(data->GetTwoByteData(start_position)) { | 301 raw_data_(data->GetTwoByteData(start_position)) { |
303 buffer_cursor_ = raw_data_, | 302 buffer_cursor_ = raw_data_, |
304 buffer_end_ = raw_data_ + (end_position - start_position); | 303 buffer_end_ = raw_data_ + (end_position - start_position); |
305 pos_ = start_position; | 304 pos_ = start_position; |
306 } | 305 } |
307 | 306 |
308 | |
309 // ---------------------------------------------------------------------------- | |
310 // Scanner::LiteralScope | |
311 | |
312 Scanner::LiteralScope::LiteralScope(Scanner* self) | |
313 : scanner_(self), complete_(false) { | |
314 self->StartLiteral(); | |
315 } | |
316 | |
317 | |
318 Scanner::LiteralScope::~LiteralScope() { | |
319 if (!complete_) scanner_->DropLiteral(); | |
320 } | |
321 | |
322 | |
323 void Scanner::LiteralScope::Complete() { | |
324 scanner_->TerminateLiteral(); | |
325 complete_ = true; | |
326 } | |
327 | |
328 } } // namespace v8::internal | 307 } } // namespace v8::internal |
OLD | NEW |