diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-06-27 17:44:31 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-06-27 17:44:31 +0200 |
commit | 9c19ab0c91b6ac3e91093a2fec12dbfdb021cfb5 (patch) | |
tree | eb89b758fff834c8ccf724362fded59c3d0ffaee | |
parent | 859a831ab061d3d906351fe213e1f7ac80ac10cb (diff) | |
download | sciteco-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.
-rw-r--r-- | src/parser.cpp | 5 |
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()); |