From 5df9e123af916923e175815fcf85906ae9d63e7a Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 8 Aug 2015 20:49:54 -0400 Subject: [PATCH] [numex] Fix to whole_tokens_only numeric experession parsing where numex was pushing a number onto the stack even on encountering a new rule context even though the token was not completely parsed --- src/numex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numex.c b/src/numex.c index efdfb8fd..81cdf7c9 100644 --- a/src/numex.c +++ b/src/numex.c @@ -788,7 +788,7 @@ numex_result_array *convert_numeric_expressions(char *str, char *lang) { FLOOR_LOG_BASE(rule.value, prev_rule.radix) < FLOOR_LOG_BASE(prev_rule.value, prev_rule.radix)) { result.value += rule.value; log_debug("Last token was RIGHT_CONTEXT_ADD, value=%lld\n", result.value); - } else if (prev_rule.rule_type != NUMEX_NULL && rule.rule_type != NUMEX_STOPWORD) { + } else if (prev_rule.rule_type != NUMEX_NULL && rule.rule_type != NUMEX_STOPWORD && (!whole_tokens_only || complete_token)) { log_debug("Had previous token with no context, finishing previous rule before returning\n"); result.len = prev_result_len;