When defining an element and using setResultsName() to store the match, it sometimes stores the actual string and sometimes it stores a ParseResults() instance. It seems to be storing a plain string if Word() matches and a ParseResults() instance if something else matches e.g. Group()
This is confusing since users have to guess what something will return and if you decide to add e.g. Optional, OneOrMore etc to a Word() it can switch from one behaviour to another.
When defining an element and using setResultsName() to store the match, it sometimes stores the actual string and sometimes it stores a ParseResults() instance. It seems to be storing a plain string if Word() matches and a ParseResults() instance if something else matches e.g. Group()
This is confusing since users have to guess what something will return and if you decide to add e.g. Optional, OneOrMore etc to a Word() it can switch from one behaviour to another.
The return types should be kept consistent.
Here is an example: