aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2015-06-27 17:44:31 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2015-06-27 17:44:31 +0200
commit9c19ab0c91b6ac3e91093a2fec12dbfdb021cfb5 (patch)
treeeb89b758fff834c8ccf724362fded59c3d0ffaee /src/parser.cpp
parent859a831ab061d3d906351fe213e1f7ac80ac10cb (diff)
downloadsciteco-9c19ab0c91b6ac3e91093a2fec12dbfdb021cfb5.tar.gz
do not imply values for the "=" command but fail instead if argument is missing
* this turned out to be a totally-useless and confusing feature. In general values should only be implied for commands if the advantages of implying values (i.e. if you will often want to imply a certain value) outweigh the reduced error checking. * this was one of the bugs discussed in #4.
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index f88ae90..3db7115 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -1315,14 +1315,17 @@ StateStart::custom(gchar chr)
* on the console.
* It is currently always formatted as a decimal integer and
* shown with the user-message severity.
+ * The command fails if <n> is not given.
*/
/**
- * @bug makes no sense to imply the sign-prefix!
* @todo perhaps care about current radix
* @todo colon-modifier to suppress line-break on console?
*/
case '=':
BEGIN_EXEC(this);
+ expressions.eval();
+ if (!expressions.args())
+ throw ArgExpectedError('=');
interface.msg(InterfaceCurrent::MSG_USER,
"%" TECO_INTEGER_FORMAT,
expressions.pop_num_calc());