blob: c5a8a69dab66ba50587a0f04d7a8d67481cc168b [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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
11namespace v8 {
12namespace internal {
13
14bool UnicodeCache::IsIdentifierStart(unibrow::uchar c) {
15 return kIsIdentifierStart.get(c);
16}
17
18
19bool UnicodeCache::IsIdentifierPart(unibrow::uchar c) {
20 return kIsIdentifierPart.get(c);
21}
22
23
24bool UnicodeCache::IsLineTerminator(unibrow::uchar c) {
25 return kIsLineTerminator.get(c);
26}
27
28
29bool UnicodeCache::IsLineTerminatorSequence(unibrow::uchar c,
30 unibrow::uchar next) {
31 if (!IsLineTerminator(c)) return false;
32 if (c == 0x000d && next == 0x000a) return false; // CR with following LF.
33 return true;
34}
35
36
37bool UnicodeCache::IsWhiteSpace(unibrow::uchar c) {
38 return kIsWhiteSpace.get(c);
39}
40
41
42bool UnicodeCache::IsWhiteSpaceOrLineTerminator(unibrow::uchar c) {
43 return kIsWhiteSpaceOrLineTerminator.get(c);
44}
45
46} // namespace internal
47} // namespace v8
48
49#endif // V8_UNICODE_CACHE_INL_H_