I have to match tokens like this using pegjs:
?xxx ?yyy
I would have thought this would work :
variable
= str:?[a-z]+ { console.log('---->>>',str); return str.join(""); }
When I parse the source I get and error:
Object ? has no method 'join'
This is because the str
variable is not an array of the matched tokens... Any idea how this should be done?