Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: src/char-predicates-inl.h

Issue 1776953002: [regexp] allow loose matching for property names. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/char-predicates.h ('k') | src/regexp/regexp-parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CHAR_PREDICATES_INL_H_ 5 #ifndef V8_CHAR_PREDICATES_INL_H_
6 #define V8_CHAR_PREDICATES_INL_H_ 6 #define V8_CHAR_PREDICATES_INL_H_
7 7
8 #include "src/char-predicates.h" 8 #include "src/char-predicates.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 inline bool IsAsciiIdentifier(uc32 c) { 38 inline bool IsAsciiIdentifier(uc32 c) {
39 return IsAlphaNumeric(c) || c == '$' || c == '_'; 39 return IsAlphaNumeric(c) || c == '$' || c == '_';
40 } 40 }
41 41
42 inline bool IsAlphaNumeric(uc32 c) { 42 inline bool IsAlphaNumeric(uc32 c) {
43 return IsInRange(AsciiAlphaToLower(c), 'a', 'z') || IsDecimalDigit(c); 43 return IsInRange(AsciiAlphaToLower(c), 'a', 'z') || IsDecimalDigit(c);
44 } 44 }
45 45
46 inline bool IsAlpha(uc32 c) {
47 return IsInRange(AsciiAlphaToLower(c), 'a', 'z');
48 }
49
50 inline bool IsDecimalDigit(uc32 c) { 46 inline bool IsDecimalDigit(uc32 c) {
51 // ECMA-262, 3rd, 7.8.3 (p 16) 47 // ECMA-262, 3rd, 7.8.3 (p 16)
52 return IsInRange(c, '0', '9'); 48 return IsInRange(c, '0', '9');
53 } 49 }
54 50
55 51
56 inline bool IsHexDigit(uc32 c) { 52 inline bool IsHexDigit(uc32 c) {
57 // ECMA-262, 3rd, 7.6 (p 15) 53 // ECMA-262, 3rd, 7.6 (p 15)
58 return IsDecimalDigit(c) || IsInRange(AsciiAlphaToLower(c), 'a', 'f'); 54 return IsDecimalDigit(c) || IsInRange(AsciiAlphaToLower(c), 'a', 'f');
59 } 55 }
(...skipping 26 matching lines...) Expand all
86 default: 82 default:
87 return true; 83 return true;
88 } 84 }
89 } 85 }
90 86
91 87
92 } // namespace internal 88 } // namespace internal
93 } // namespace v8 89 } // namespace v8
94 90
95 #endif // V8_CHAR_PREDICATES_INL_H_ 91 #endif // V8_CHAR_PREDICATES_INL_H_
OLDNEW
« no previous file with comments | « src/char-predicates.h ('k') | src/regexp/regexp-parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698