Inconsistent skip sets error even with closing tag

I’m trying to implement a skip rule, but only within the perimeters of some parenthesis.


I get the following error: Inconsistent skip sets after Action HEADER “(” Keyword
I can mitigate this error by removing the ? and * on the terms that are optional after Keyword, but I thought I would be able to have optional terms inside the skipping area since I have a definitive opening and closing parenthesis.

You don’t show your StringValue rule, but I assume it’s a rule in the global skip set, defined in such a way that it doesn’t contain its skip behavior inside itself.

Here are all the tokens being used inside OPTIONS:

Keyword { ($[a-zA-Z_\-.])+ }

Number { $[0-9]+ }

VariableName { $[a-zA-Z0-9_/\-.]+ }

@precedence { Number, VariableName }

Opertor { ($[=<>] "="?) | "!=" }

StringValue { ![\"\”\n\r] }

Space { @whitespace+ }

I don’t have any other skip rules in the grammar, I only want to skip whitespace inside of the parenthesis. When I define DictValue { Keyword (":")? } I still get the same error.

Ah, right, it’s DictValue that’s causing the problem. After a “(” and a keyword, the colon part is optional, so either DictValue is already done, or it still matches more. In your grammar, if it is done, the Space skip rule would be in effect after the keyword, but if more content follows, the global skip rule is in effect in DictValue. So that’s inconsistent, and the tool doesn’t allow it.

1 Like

Thank you, that did it! I was able to solve it by moving the semicolon into the DictValue:

DictValue { Keyword (":" String | Variables)? ";" }