I need to store 2 arrays for each line. Some of the indentation rules depend upon what was in the preceding lines.
Some statements go to multiple lines:
READ D FROM FILEVAR,KEY ELSE
D = ''
A = 'WE GOT NOTHING'
A = 'WE GOT SOMETHING'
In this example, we know that we wish to add to the indention level after the ELSE clause, reduce before END THEN, add after and then reduce again before the final END.
This is but 1 way that the syntax allows.
If I capture the keywords on the line in an array:
horizontal = 'READ'
horizontal = 'ELSE'
vertical = 'READ'
I can now determine when to increase the indention level.
What has been a problem was the pushing and popping of these arrays when they are attached to the state object and when that object is passed into the indent() function.
It almost works.