Index: src/globals.h |
diff --git a/src/globals.h b/src/globals.h |
index e8384722aef6a852546b4187803930e1b5d513aa..e71314f9c1af9558e6e249e16cdaab7dca870397 100644 |
--- a/src/globals.h |
+++ b/src/globals.h |
@@ -8,6 +8,8 @@ |
#include <stddef.h> |
#include <stdint.h> |
+#include <ostream> |
+ |
#include "src/base/build_config.h" |
#include "src/base/logging.h" |
#include "src/base/macros.h" |
@@ -238,6 +240,20 @@ enum LanguageMode { |
}; |
+inline std::ostream& operator<<(std::ostream& os, LanguageMode mode) { |
+ switch (mode) { |
+ case SLOPPY: |
+ return os << "sloppy"; |
+ case STRICT: |
+ return os << "strict"; |
+ case STRONG: |
+ return os << "strong"; |
+ default: |
+ return os << "unknown"; |
+ } |
+} |
+ |
+ |
inline bool is_sloppy(LanguageMode language_mode) { |
return (language_mode & STRICT_BIT) == 0; |
} |