Index: src/scanner.h |
diff --git a/src/scanner.h b/src/scanner.h |
index 0e3013f4b8f7d6a910dcb9e26042b40238c1aaa2..94f9102c042cddbbffe03865e7c533128017179b 100644 |
--- a/src/scanner.h |
+++ b/src/scanner.h |
@@ -565,12 +565,16 @@ class Scanner { |
} |
// Low-level scanning support. |
- template <bool capture_raw = false> |
+ template <bool capture_raw = false, bool check_surrogate = true> |
void Advance() { |
if (capture_raw) { |
AddRawLiteralChar(c0_); |
} |
c0_ = source_->Advance(); |
+ if (check_surrogate) HandleLeadSurrugate(); |
+ } |
+ |
+ void HandleLeadSurrugate() { |
if (unibrow::Utf16::IsLeadSurrogate(c0_)) { |
uc32 c1 = source_->Advance(); |
if (!unibrow::Utf16::IsTrailSurrogate(c1)) { |