|
|
|
@ -984,6 +984,7 @@ class CalculateExtension(Extension):
|
|
|
|
|
|
|
|
|
|
self.tags = {'calculate', 'save', 'set_var'}
|
|
|
|
|
self.CONDITION_TOKENS_TYPES = {'eq', 'ne', 'lt', 'gt', 'lteq', 'gteq'}
|
|
|
|
|
self.CONDITION_NAME_TOKENS = {'not'}
|
|
|
|
|
self.LITERAL_TOKENS_TYPES = {'string', 'integer', 'float'}
|
|
|
|
|
|
|
|
|
|
if hasattr(self._datavars, 'variables_to_save'):
|
|
|
|
@ -1069,7 +1070,9 @@ class CalculateExtension(Extension):
|
|
|
|
|
and self.stream.current.value in self._parameters_set
|
|
|
|
|
and self.stream.look().type != 'dot'
|
|
|
|
|
and self.stream.look().type not in
|
|
|
|
|
self.CONDITION_TOKENS_TYPES):
|
|
|
|
|
self.CONDITION_TOKENS_TYPES
|
|
|
|
|
and self.stream.current.value not in
|
|
|
|
|
self.CONDITION_NAME_TOKENS):
|
|
|
|
|
# разбираем параметр.
|
|
|
|
|
# pairs_list.append(self.get_parameter_node())
|
|
|
|
|
name_node, value_node = self._get_parameter()
|
|
|
|
@ -1091,7 +1094,8 @@ class CalculateExtension(Extension):
|
|
|
|
|
|
|
|
|
|
elif (self._is_variable_name(self.stream.current)
|
|
|
|
|
or self.stream.current.type == 'lparen'
|
|
|
|
|
or self.stream.current.type == 'integer'):
|
|
|
|
|
or self.stream.current.type == 'integer'
|
|
|
|
|
or self.stream.current.value in self.CONDITION_NAME_TOKENS):
|
|
|
|
|
# разбираем условие. Если условие False -- кидаем исключение.
|
|
|
|
|
# condition_result = self.get_condition_result()
|
|
|
|
|
# if not condition_result:
|
|
|
|
|