summaryrefslogtreecommitdiff
path: root/src/token.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-19 13:41:42 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-19 13:41:42 -0700
commitf7035d970fc629e3e95f03dd5f4e9618cb3230d7 (patch)
tree6cfa1cd977dde6680189b1c1c3bf0589cdad377c /src/token.cpp
parent3bb307b470876561509904172d3aaede10e5eb62 (diff)
downloadclic-f7035d970fc629e3e95f03dd5f4e9618cb3230d7.tar.gz
clic-f7035d970fc629e3e95f03dd5f4e9618cb3230d7.tar.bz2
clic-f7035d970fc629e3e95f03dd5f4e9618cb3230d7.tar.xz
clic-f7035d970fc629e3e95f03dd5f4e9618cb3230d7.zip
Parsing commands is almost there.
Diffstat (limited to '')
-rw-r--r--src/token.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/token.cpp b/src/token.cpp
index ff04e94..7ec9b98 100644
--- a/src/token.cpp
+++ b/src/token.cpp
@@ -103,6 +103,12 @@ Bu::Formatter &operator<<( Bu::Formatter &f, Token::Type eType )
103 case Token::tNegate: return f << "neg"; 103 case Token::tNegate: return f << "neg";
104 case Token::tUninitialized: return f << "<->"; 104 case Token::tUninitialized: return f << "<->";
105 case Token::tComputedValue: return f << "cmp"; 105 case Token::tComputedValue: return f << "cmp";
106 case Token::tCmdExit: return f << "cmd (exit)";
107 case Token::tCmdScale: return f << "cmd (scale)";
108 case Token::tCmdRadix: return f << "cmd (radix)";
109 case Token::tCmdExtended: return f << "cmd (ext)";
110 case Token::tCmdParam: return f << "cpr";
111 case Token::tCmdEndParams: return f << "cpe";
106 112
107 default: return f << "???"; 113 default: return f << "???";
108 } 114 }
@@ -113,7 +119,10 @@ Bu::Formatter &operator<<( Bu::Formatter &f, const Token &t )
113 f << t.eType; 119 f << t.eType;
114 if( t.eType == Token::tNumber ) 120 if( t.eType == Token::tNumber )
115 f << "(" << (t.nVal?t.nVal->toString():"<null>") << ")"; 121 f << "(" << (t.nVal?t.nVal->toString():"<null>") << ")";
116 else if( t.eType == Token::tString || t.eType == Token::tVariable ) 122 else if( t.eType == Token::tString ||
123 t.eType == Token::tVariable ||
124 t.eType == Token::tCmdExtended ||
125 t.eType == Token::tCmdParam )
117 f << "(" << (t.sVal?*(t.sVal):"<null>") << ")"; 126 f << "(" << (t.sVal?*(t.sVal):"<null>") << ")";
118 return f; 127 return f;
119} 128}