(I am not a parlset developer, just a user....)

The first one I think is:

str('foo').present?  # matches when the input contains 'foo', but leaves it

(This is the converse of the negative lookeahead .absent? that Kaspar mentioned recently).

The second one.... I think, if I'm remembering understanding such, that pretty much nothing shows up in the Parslet parse tree _unless_ you specifically mark it to do so. So an option to not include something in parse tree is not neccesary, it's not going to show up in parse tree unless you mark it with #as. It gets complicated to do that sometimes, and there might be a case wehre the "don't include in parse tree directive even if we otherwise woudl be" directive could conceivably be useful, but I don't think it exists.

Jonathan



On 7/20/2011 3:57 PM, Frank wrote:
Hi,
What are the parslet equivalents of '&' and '`' (the back-tick)? For Anyone unfamiliar with these operators, the & indicates the element to the right must follow (but the marked element itself does not absorb anything) while the back-tick means the parser is not to include the matched text in the parse tree; the parser must still match the text for success pattern matching; it just never appears in the final parse tree.

Thanks in advance!

Reply via email to