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

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

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/builtins.cc ('k') | src/checks.h » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 struct IdentifierPartNotLetter { 70 struct IdentifierPartNotLetter {
71 static inline bool Is(uc32 c) { 71 static inline bool Is(uc32 c) {
72 return unibrow::Number::Is(c) 72 return unibrow::Number::Is(c)
73 || c == 0x200C // U+200C is Zero-Width Non-Joiner. 73 || c == 0x200C // U+200C is Zero-Width Non-Joiner.
74 || c == 0x200D // U+200D is Zero-Width Joiner. 74 || c == 0x200D // U+200D is Zero-Width Joiner.
75 || unibrow::CombiningMark::Is(c) 75 || unibrow::CombiningMark::Is(c)
76 || unibrow::ConnectorPunctuation::Is(c); 76 || unibrow::ConnectorPunctuation::Is(c);
77 } 77 }
78 }; 78 };
79 79
80
81 // WhiteSpace according to ECMA-262 5.1, 7.2.
82 struct WhiteSpace {
83 static inline bool Is(uc32 c) {
84 return c == 0x0009 || // <TAB>
85 c == 0x000B || // <VT>
86 c == 0x000C || // <FF>
87 c == 0xFEFF || // <BOM>
88 // \u0020 and \u00A0 are included in unibrow::WhiteSpace.
89 unibrow::WhiteSpace::Is(c);
90 }
91 };
92
93
94 // WhiteSpace and LineTerminator according to ECMA-262 5.1, 7.2 and 7.3.
95 struct WhiteSpaceOrLineTerminator {
96 static inline bool Is(uc32 c) {
97 return WhiteSpace::Is(c) || unibrow::LineTerminator::Is(c);
98 }
99 };
100
80 } } // namespace v8::internal 101 } } // namespace v8::internal
81 102
82 #endif // V8_CHAR_PREDICATES_H_ 103 #endif // V8_CHAR_PREDICATES_H_
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/checks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698