summaryrefslogtreecommitdiff
path: root/deps/v8/src/unicode-cache-inl.h
blob: 7f735896668f9ea4ab9029721f6beac4270ef01e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_UNICODE_CACHE_INL_H_
#define V8_UNICODE_CACHE_INL_H_

#include "src/unicode-inl.h"
#include "src/unicode-cache.h"

namespace v8 {
namespace internal {

bool UnicodeCache::IsIdentifierStart(unibrow::uchar c) {
  return kIsIdentifierStart.get(c);
}


bool UnicodeCache::IsIdentifierPart(unibrow::uchar c) {
  return kIsIdentifierPart.get(c);
}

bool UnicodeCache::IsLineTerminatorSequence(unibrow::uchar c,
                                            unibrow::uchar next) {
  if (!unibrow::IsLineTerminator(c)) return false;
  if (c == 0x000d && next == 0x000a) return false;  // CR with following LF.
  return true;
}


bool UnicodeCache::IsWhiteSpace(unibrow::uchar c) {
  return kIsWhiteSpace.get(c);
}


bool UnicodeCache::IsWhiteSpaceOrLineTerminator(unibrow::uchar c) {
  return kIsWhiteSpaceOrLineTerminator.get(c);
}

}  // namespace internal
}  // namespace v8

#endif  // V8_UNICODE_CACHE_INL_H_