Re: [Seed7-users] Parameter Bug with Multi-Dimensional Arrays
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2021-01-06 09:58:18
|
Hi Zachary, I have fixed this issue, and in the next release it will work without problems. Here is an explanation, how this error was triggered: "in" parameters have been handled different than other parameters (“inout”, “in var”, “ref” or “val”). The other parameters are defined in the beginning of seed7_05.s7i as functions that take the type as argument. This can be parsed before the actual type declaration has been executed. E.g.: inout array array string: aName can be parsed. When this expression is executed the new two-dimensional array type is generated and passed to the "inout" parameter function. The "in" parameters have been defined as attribute of a type (they have been declared in the functions IN_PARAM_IS_VALUE respectively IN_PARAM_IS_REFERENCE). To parse an expression with an attribute the type must exist. Therefore parsing in array array string: aName fails, as the new two-dimensional array type will be generated later, when the expression is executed. I solved this issue by defining "in" parameters the same way as all other parameters. Now "in" parameters are not defined as attribute of a type, but as function that takes the type as argument. What an "in" parameter should do is now stored directly in the type. The functions IN_PARAM_IS_VALUE and IN_PARAM_IS_REFERENCE have been changed to store this information in the type. Regards Thomas Mertes |