summaryrefslogtreecommitdiff
path: root/src/token.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/token.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/token.cpp b/src/token.cpp
index 1eaa92a..0c7bda1 100644
--- a/src/token.cpp
+++ b/src/token.cpp
@@ -100,8 +100,20 @@ Bu::Formatter &operator<<( Bu::Formatter &f, Token::Type eType )
100 case Token::tEndOfLine: return f << "eol"; 100 case Token::tEndOfLine: return f << "eol";
101 case Token::tEndOfInput: return f << "eoi"; 101 case Token::tEndOfInput: return f << "eoi";
102 case Token::tNegate: return f << "neg"; 102 case Token::tNegate: return f << "neg";
103 case Token::tUninitialized: return f << "<->";
104 case Token::tComputedValue: return f << "cmp";
103 105
104 default: return f << "???"; 106 default: return f << "???";
105 } 107 }
106} 108}
107 109
110Bu::Formatter &operator<<( Bu::Formatter &f, const Token &t )
111{
112 f << t.eType;
113 if( t.eType == Token::tNumber )
114 f << "(" << (t.nVal?t.nVal->toString():"<null>") << ")";
115 else if( t.eType == Token::tString || t.eType == Token::tVariable )
116 f << "(" << (t.sVal?*(t.sVal):"<null>") << ")";
117 return f;
118}
119