diff options
Diffstat (limited to '')
-rw-r--r-- | src/scriptengine.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/scriptengine.cpp b/src/scriptengine.cpp index e4c5c2e..6a00af8 100644 --- a/src/scriptengine.cpp +++ b/src/scriptengine.cpp | |||
@@ -105,7 +105,7 @@ void ScriptEngine::exec( Expression *pExpr ) | |||
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | if( sigNumResult.isSet() ) | 108 | if( sigNumResult.isSet() && !sNums.isEmpty() ) |
109 | sigNumResult( sNums.peekPop() ); | 109 | sigNumResult( sNums.peekPop() ); |
110 | } | 110 | } |
111 | 111 | ||
@@ -134,12 +134,34 @@ void ScriptEngine::command( Expression::iterator &i ) | |||
134 | } | 134 | } |
135 | if( sigMessage.isSet() ) | 135 | if( sigMessage.isSet() ) |
136 | sigMessage(Bu::String("Changed scale to: %1").arg( iScale )); | 136 | sigMessage(Bu::String("Changed scale to: %1").arg( iScale )); |
137 | for( VarHash::iterator i = hVarState.begin(); i; i++ ) | 137 | for( VarHash::iterator j = hVarState.begin(); j; j++ ) |
138 | (*i).setScale( iScale ); | 138 | (*j).setScale( iScale ); |
139 | i++; | ||
139 | } | 140 | } |
140 | break; | 141 | break; |
141 | 142 | ||
142 | case Token::tCmdRadix: | 143 | case Token::tCmdRadix: |
144 | { | ||
145 | if( !(++i) ) | ||
146 | { | ||
147 | if( sigError.isSet() ) | ||
148 | sigError("You must provide a positive integer."); | ||
149 | return; | ||
150 | } | ||
151 | int32_t iRadix = strtol( (*i).sVal->getStr(), 0, 10 ); | ||
152 | if( iRadix < 0 ) | ||
153 | { | ||
154 | if( sigError.isSet() ) | ||
155 | sigError("You must provide a positive integer."); | ||
156 | return; | ||
157 | } | ||
158 | if( sigMessage.isSet() ) | ||
159 | sigMessage(Bu::String("Changed radix to: %1").arg( iRadix )); | ||
160 | hVarState.clear(); | ||
161 | // for( VarHash::iterator i = hVarState.begin(); i; i++ ) | ||
162 | // (*i).setRadix( iRadix ); | ||
163 | i++; | ||
164 | } | ||
143 | break; | 165 | break; |
144 | 166 | ||
145 | case Token::tCmdExtended: | 167 | case Token::tCmdExtended: |
@@ -155,5 +177,8 @@ void ScriptEngine::command( Expression::iterator &i ) | |||
155 | }*/ | 177 | }*/ |
156 | break; | 178 | break; |
157 | } | 179 | } |
180 | |||
181 | if( (*i).eType != Token::tCmdEndParams ) | ||
182 | sigError("Too many parameters."); | ||
158 | } | 183 | } |
159 | 184 | ||