Invalid input parsed and interpreted differently
Let us have this valid input:
s = (n: 1, 2, 3, 4); print(s where n > 1)
Everything works fine. Now let us modify the input and introduce an error
s = (n: 1, 2, 3, 4); print(s where s > 1)
This results in no DSL error. The instant executor bahaves as with the correct syntax. The deferred and workflow executors issue this Python assertion error:
INFO:root:running in deferred_mode
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 91, in wrapper
return func(*args, **kwargs)
File "../scripts/run_model.py", line 73, in evaluate_prog
print(f'program output: >>>\n{prog.value}\n<<<')
File "/usr/lib64/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/utilities/errors.py", line 34, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/interpreter/instant_executor.py", line 49, in program_value
vals = [p.value for p in get_children_of_type('Print', self) if p.value]
File "vre-language/src/virtmat/language/interpreter/instant_executor.py", line 49, in <listcomp>
vals = [p.value for p in get_children_of_type('Print', self) if p.value]
File "/usr/lib64/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "vre-language/src/virtmat/language/utilities/errors.py", line 41, in wrapper
raise TextXError(str(err), **loc, context=con) from err
textx.exceptions.TextXError: vre-language/examples/14.vm:1:22: => 'print(s where s > 1)'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "../scripts/run_model.py", line 96, in <module>
main()
File "../scripts/run_model.py", line 92, in main
evaluate_prog(clargs, prog)
File "vre-language/src/virtmat/language/utilities/errors.py", line 93, in wrapper
process_error(err)
File "vre-language/src/virtmat/language/utilities/errors.py", line 76, in process_error
raise err.__cause__
File "vre-language/src/virtmat/language/utilities/errors.py", line 34, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/utilities/types.py", line 92, in wrapper
return checktype_(func(obj), obj.type_)
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 905, in func_value
return func(*[p.value for p in pars])
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 90, in retfunc
values = [formatter(f(*a)) for f, a in zip(funcs, pargs)]
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 90, in <listcomp>
values = [formatter(f(*a)) for f, a in zip(funcs, pargs)]
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 328, in get_query_value
fconds = [f(*a) for f, a in zip(cfunc, fargs)]
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 328, in <listcomp>
fconds = [f(*a) for f, a in zip(cfunc, fargs)]
File "vre-language/src/virtmat/language/interpreter/deferred_executor.py", line 416, in retfunc4
assert val.name == left
AssertionError