While adding a rule for enforced named parameter in Skila I wished I could add simple expression to parsing rule like:
param := IDENT=named IDENT COLON IDENT
which would translate that I can have two identifiers in a row, however first has to be equal to “named”. Since NLT is not a generator suite, instead of this straightforward approach I added extra lambda where you can make such comparison yourself. As a bonus I added ability to set custom error message and control if the parsing should continue or stop (check NLT package for details).
Relaxed (job done), I prepared to publish the package, I added small new example for this feature, I checked old examples — bang! Infinite loop in lexer, what the devil? Apparently the one that loves details — I didn’t validate lexer rules whether they match empty input. Such lexer rule:
IDENT = [a-zA-Z]*
asks for trouble because it will work as fallback rule some day matching zero characters and moving forward by zero characters. Not any longer, fixed!