Open MinusGix opened 2 years ago
Hi @MinusGix,
I would like to work on this issue. I understand that the validation needs to be updated in sugarcube-2/macros.json. Kindly confirm, and assign me this issue.
The issue is about implementing the checks to validate the proposed after
field, and so would need more than just modifications to the macros.json
file. See: https://github.com/cyrusfirheir/twee3-language-tools/blob/master/src/sugarcube-2/macros.ts#L518 (I'm open to splitting off that bit of code to a separate function to make it cleaner, too).
If you still feel up for it, then I can assign this to you.
Thanks for the update, @MinusGix. I am sorry but this seems to be beyond my current level of expertise. Apologies.
IT would be useful to provide an error when putting the else macro before the elseif macro in an if statement.
While we could add a complex feature to the children's tags to allow specifying complex patterns, I think this can be resolved in a good enough manner by just adding a field to a children called
after
which specifies the names of other children that it must appear after.And so if it sees an
else
beforeelseif
(which isn't too complex of a modification of the existing counting code), then it produces an error.