Index: runtime/vm/token.cc |
diff --git a/runtime/vm/token.cc b/runtime/vm/token.cc |
index 75872e5d1077087923eb9636641cb6bfbac30f96..504b6d90a81bd40c4587503f83096ba6bbc322d5 100644 |
--- a/runtime/vm/token.cc |
+++ b/runtime/vm/token.cc |
@@ -78,4 +78,21 @@ bool Token::IsUnaryArithmeticOperator(Token::Kind token) { |
} |
+const char* ClassifyingTokenPositions::ToCString(intptr_t token_pos) { |
+ ASSERT(token_pos < Token::kMinSourcePos); |
+ COMPILE_ASSERT(ClassifyingTokenPositions::kPrivate == |
+ (Token::kNoSourcePos - 1)); |
+ COMPILE_ASSERT(kLast < kPrivate); |
+ switch (token_pos) { |
+ case Token::kNoSourcePos: return "NoSource"; |
+#define DEFINE_CASE(name, value) \ |
+ case value: return #name; |
+ CLASSIFYING_TOKEN_POSITIONS(DEFINE_CASE); |
+#undef DEFINE_CASE |
+ default: |
+ UNIMPLEMENTED(); |
+ return NULL; |
+ } |
+} |
+ |
} // namespace dart |