| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 bool EvenMoreExperimentalScanner::ValidIdentifierStart() { | 112 bool EvenMoreExperimentalScanner::ValidIdentifierStart() { |
| 113 return unicode_cache_->IsIdentifierStart(ScanHexNumber(4)); | 113 return unicode_cache_->IsIdentifierStart(ScanHexNumber(4)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 | 116 |
| 117 uint32_t EvenMoreExperimentalScanner::push(const void *input, int input_size) { | 117 uint32_t EvenMoreExperimentalScanner::push(const void *input, int input_size) { |
| 118 // FIXME: for now, we can only push once and that'll read the input. | 118 // FIXME: for now, we can only push once and that'll read the input. |
| 119 if (input_size == 0) | 119 if (input_size == 0) |
| 120 return 0; | 120 return 0; |
| 121 buffer_ = const_cast<YYCTYPE*>(reinterpret_cast<const YYCTYPE*>(input)); | 121 buffer_ = const_cast<YYCTYPE*>(reinterpret_cast<const YYCTYPE*>(input)); |
| 122 cursor_ = buffer_ - 1; | 122 cursor_ = buffer_; |
| 123 start_ = buffer_; | 123 start_ = buffer_; |
| 124 buffer_end_ = buffer_ + input_size; | 124 buffer_end_ = buffer_ + input_size; |
| 125 return DoLex(); | 125 return DoLex(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 void EvenMoreExperimentalScanner::send(Token::Value token) { | 129 void EvenMoreExperimentalScanner::send(Token::Value token) { |
| 130 int beg = start_ - buffer_; | 130 int beg = start_ - buffer_; |
| 131 int end = cursor_ - buffer_; | 131 int end = cursor_ - buffer_; |
| 132 sink_->Record(token, beg, end); | 132 sink_->Record(token, beg, end); |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 } | 136 } |
| 137 } | 137 } |
| OLD | NEW |