numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
18 stars 6 forks source link

String expressions cannot be used as indices #58

Closed numeredev closed 1 year ago

numeredev commented 1 year ago

DESCRIPTION

Describe the bug In the screenshot below, we're trying to decode an XML file into a linear structure. Because there are recurring patterns, we want to extract the identical code into another procedure, which returns the parameters as key-value list, and call that procedure multiple times. There seems to be a problem with the highlighted indices: if the expression of the index is used instead, it creates a never-ending loop.

To Reproduce Steps to reproduce the behavior:

  1. Create a similar pocedure
  2. Use the expression with the key-value list as index
  3. See error

Expected behavior The index should be evaluated instead of creating a never-ending loop.

Screenshots grafik

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

A complete analysis is not possible without actually resolving the issue. We could track it down to a recursion from void getIndices(...) in indices.cpp into StringParser::StringParserRetVal StringParser::evalAndFormat(...) due to the string expression used here, which does not return any more. There might be two issues:

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST