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

Unified Diff: src/ostreams.cc

Issue 1578253005: [regexp] implement character classes for unicode regexps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: more tests Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ostreams.h ('k') | src/regexp/jsregexp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ostreams.cc
diff --git a/src/ostreams.cc b/src/ostreams.cc
index a7a67f5d2f06002fc9899b7c391476fd16022932..120db257cd19e27fe91068c4dab99dfba709e9f7 100644
--- a/src/ostreams.cc
+++ b/src/ostreams.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "src/ostreams.h"
+#include "src/objects.h"
#if V8_OS_WIN
#if _MSC_VER < 1900
@@ -60,6 +61,16 @@ std::ostream& PrintUC16(std::ostream& os, uint16_t c, bool (*pred)(uint16_t)) {
return os << buf;
}
+
+std::ostream& PrintUC32(std::ostream& os, int32_t c, bool (*pred)(uint16_t)) {
+ if (c <= String::kMaxUtf16CodeUnit) {
+ return PrintUC16(os, static_cast<uint16_t>(c), pred);
+ }
+ char buf[13];
+ snprintf(buf, sizeof(buf), "\\u{%06x}", c);
+ return os << buf;
+}
+
} // namespace
@@ -81,5 +92,10 @@ std::ostream& operator<<(std::ostream& os, const AsUC16& c) {
return PrintUC16(os, c.value, IsPrint);
}
+
+std::ostream& operator<<(std::ostream& os, const AsUC32& c) {
+ return PrintUC32(os, c.value, IsPrint);
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/ostreams.h ('k') | src/regexp/jsregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698