From 9c19ab0c91b6ac3e91093a2fec12dbfdb021cfb5 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 27 Jun 2015 17:44:31 +0200 Subject: 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. --- src/parser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/parser.cpp') 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 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()); -- cgit v1.2.3