Commit 59581288 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Check that procedure with a return are called from TASKs only

parent 4948d868
......@@ -112,6 +112,14 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
3.0.8 (06/2020)
- Support ASN.1 integer constants with no range (plain x INTEGER ::= 5)
- Check that procedures with a return type are called only from TASKs
3.0.7 (06/2020)
- Fix update of data dictionary window
- Fix unconstained constants support
3.0.6 (06/2020)
- Fix CONNECT symbol
......
......@@ -4762,6 +4762,15 @@ def transition(root, parent, context):
if child.type == lexer.PROCEDURE_CALL:
proc_call, err, warn = procedure_call(
child, parent=parent, context=context)
# Check if the procedure call has a return type
# In that case it is an error, it must be called from
# a TASK to assign the result to a variable
if proc_call.exprType is not None:
call_name = proc_call.output[0]['outputName']
err.append([f"A procedure with a return type must be called"
f" from a TASK symbol (syntax: ret := call {call_name}"
" (params))",
[proc_call.pos_x or 0, proc_call.pos_y or 0], []])
errors.extend(err)
warnings.extend(warn)
trans.actions.append(proc_call)
......
......@@ -140,7 +140,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '3.0.7'
__version__ = '3.0.8'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment