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

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

Issue 13014: Rudimentary assertion expansion (Closed)
Patch Set: Created 12 years 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 inline bool IsHexDigit(uc32 c) { 53 inline bool IsHexDigit(uc32 c) {
54 // ECMA-262, 3rd, 7.6 (p 15) 54 // ECMA-262, 3rd, 7.6 (p 15)
55 return 55 return
56 ('0' <= c && c <= '9') || 56 ('0' <= c && c <= '9') ||
57 ('A' <= c && c <= 'F') || 57 ('A' <= c && c <= 'F') ||
58 ('a' <= c && c <= 'f'); 58 ('a' <= c && c <= 'f');
59 } 59 }
60 60
61 61
62 inline bool IsRegExpWord(uc16 c) {
63 return ('a' <= c && c <= 'z')
64 || ('A' <= c && c <= 'Z')
65 || ('0' <= c && c <= '9')
66 || (c == '_');
67 }
68
69
70 inline bool IsRegExpNewline(uc16 c) {
71 switch (c) {
72 // CR LF LS PS
73 case 0x000A: case 0x000D: case 0x2028: case 0x2029:
74 return false;
75 default:
76 return true;
77 }
78 }
79
80
62 } } // namespace v8::internal 81 } } // namespace v8::internal
63 82
64 #endif // V8_CHAR_PREDICATES_INL_H_ 83 #endif // V8_CHAR_PREDICATES_INL_H_
OLDNEW
« no previous file with comments | « src/char-predicates.h ('k') | src/jsregexp.h » ('j') | src/jsregexp.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698