I have multiple rules that are like
identifierList
^ identifier, ($, asParser trim, identifier) star
It parses a list of identifiers. The output is
#('abc' #(#($, 'def') #($, 'ghj')))
What I like to have is an output of
#( 'abc' 'def' 'ghj' )
I can produce this by changing the rule to
^ identifier , (($, asParser trim, identifier) ==> [:nodes| nodes second]) star
==> [:nodes| (Array with: nodes first) copyWithAll: nodes second ]
But now the rule is uglified. It doesn't work with flatten because I it would flatten
all together and I want to have the identifiers separated. What would be useful is a
"skip" keyword for the parser so that it is skipped for the output nodes (that
would be something like ?: in perl regex).
Are there some better way to do this?
thanks in advance,
Norbert