1 // Copyright 2015 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_UNICODE_CACHE_INL_H_ 6 #define V8_UNICODE_CACHE_INL_H_ 7 8 #include "src/unicode-inl.h" 9 #include "src/unicode-cache.h" 10 11 namespace v8 { 12 namespace internal { 13 IsIdentifierStart(unibrow::uchar c)14bool UnicodeCache::IsIdentifierStart(unibrow::uchar c) { 15 return kIsIdentifierStart.get(c); 16 } 17 18 IsIdentifierPart(unibrow::uchar c)19bool UnicodeCache::IsIdentifierPart(unibrow::uchar c) { 20 return kIsIdentifierPart.get(c); 21 } 22 IsLineTerminatorSequence(unibrow::uchar c,unibrow::uchar next)23bool UnicodeCache::IsLineTerminatorSequence(unibrow::uchar c, 24 unibrow::uchar next) { 25 if (!unibrow::IsLineTerminator(c)) return false; 26 if (c == 0x000d && next == 0x000a) return false; // CR with following LF. 27 return true; 28 } 29 30 IsWhiteSpace(unibrow::uchar c)31bool UnicodeCache::IsWhiteSpace(unibrow::uchar c) { 32 return kIsWhiteSpace.get(c); 33 } 34 35 IsWhiteSpaceOrLineTerminator(unibrow::uchar c)36bool UnicodeCache::IsWhiteSpaceOrLineTerminator(unibrow::uchar c) { 37 return kIsWhiteSpaceOrLineTerminator.get(c); 38 } 39 40 } // namespace internal 41 } // namespace v8 42 43 #endif // V8_UNICODE_CACHE_INL_H_ 44