# HG changeset patch
# User mjsousa
# Date 1464283817 -3600
# Node ID 1e3cefbbdee2c8e6a0289b77c32907aa3037ee26
# Parent  49c4edf76e6360de080fc5c5b10d50491d87c34a
Only allow function invocation outside ST expressions when command line option is activated.

diff -r 49c4edf76e63 -r 1e3cefbbdee2 stage1_2/iec_bison.yy
--- a/stage1_2/iec_bison.yy	Thu May 26 17:59:01 2016 +0100
+++ b/stage1_2/iec_bison.yy	Thu May 26 18:30:17 2016 +0100
@@ -7905,7 +7905,15 @@
 | subprogram_control_statement
 | selection_statement
 | iteration_statement
-| function_invocation /* TODO: this must be conditional on command line parameter! */
+| function_invocation 
+	{ /* This is a non-standard extension (calling a function outside an ST expression!) */
+	  /* Only allow this if command line option has been selected...                     */
+	  $$ = $1; 
+	  if (!runtime_options.allow_void_datatype) {
+	    print_err_msg(locf(@1), locl(@1), "Function invocation in ST code is not allowed outside an expression. To allow this non-standard syntax, activate the apropriate command line option."); 
+	    yynerrs++;
+	  }
+	}  
 ;