summaryrefslogtreecommitdiff
path: root/src/token.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-13 12:46:09 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-13 12:46:09 -0700
commit7e0edb6c2db17c87415fbd041ef7add9dfb467e5 (patch)
tree2feddf5d1dde80d97b2eefdd299cbebc0d2e30d4 /src/token.cpp
parent5d59aa3e9dffe2912215335ce0b76c67ebbe5a4e (diff)
downloadclic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.tar.gz
clic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.tar.bz2
clic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.tar.xz
clic-7e0edb6c2db17c87415fbd041ef7add9dfb467e5.zip
Corrected negation and single value parse bugs.
Discovered arithmetic bug in the Number class, -4 + 5 is coming back as -1, not 1. It's getting the sign wrong somehow. I'll have to hunt that down.
Diffstat (limited to '')
-rw-r--r--src/token.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/token.cpp b/src/token.cpp
index 0c7bda1..ff04e94 100644
--- a/src/token.cpp
+++ b/src/token.cpp
@@ -45,8 +45,9 @@ Token::~Token()
45 break; 45 break;
46 46
47 case tVariable: 47 case tVariable:
48 case tCommand:
49 case tString: 48 case tString:
49 case tCmdExtended:
50 case tCmdParam:
50 delete sVal; 51 delete sVal;
51 break; 52 break;
52 53
@@ -64,8 +65,9 @@ Token &Token::operator=( const Token &rhs )
64 break; 65 break;
65 66
66 case tVariable: 67 case tVariable:
67 case tCommand:
68 case tString: 68 case tString:
69 case tCmdExtended:
70 case tCmdParam:
69 delete sVal; 71 delete sVal;
70 break; 72 break;
71 73
@@ -87,7 +89,6 @@ Bu::Formatter &operator<<( Bu::Formatter &f, Token::Type eType )
87 { 89 {
88 case Token::tNumber: return f << "num"; 90 case Token::tNumber: return f << "num";
89 case Token::tVariable: return f << "var"; 91 case Token::tVariable: return f << "var";
90 case Token::tCommand: return f << "cmd";
91 case Token::tPlus: return f << "+"; 92 case Token::tPlus: return f << "+";
92 case Token::tMinus: return f << "-"; 93 case Token::tMinus: return f << "-";
93 case Token::tDivide: return f << "/"; 94 case Token::tDivide: return f << "/";