Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value to ignore output for the rule #7

Closed
Phrogz opened this issue Jul 9, 2010 · 3 comments
Closed

Return value to ignore output for the rule #7

Phrogz opened this issue Jul 9, 2010 · 3 comments
Labels

Comments

@Phrogz
Copy link

Phrogz commented Jul 9, 2010

In some grammars there are separators that are important to the grammar but uninteresting in the output from the parse tree. Whitespace is the most obvious example.

It'd be cool if there was a way, from within a rule action, to indicate that the output of the rule should not be included in the parse tree.

Since null is already taken to indicate a match/predicate failure, and false is conceivable as a desired return value, perhaps a return value of undefined could be used to cull the rule's output.

@dmajda
Copy link
Contributor

dmajda commented Jul 18, 2010

I want to concentrate on usability issues in version 0.7. I don't like the undefined idea much, but I agree that this is a problem that should be addressed in some way.

@ghost ghost assigned dmajda Aug 13, 2011
@dmajda
Copy link
Contributor

dmajda commented Nov 22, 2012

I'll look into this sometime after 1.0.0.

@dmajda
Copy link
Contributor

dmajda commented Jan 24, 2014

Deciding whether something belongs into the parse tree based on action return value seems to me as a wrong way to ignore some parts of the input. I won't implement this.

See also #11, which deals with a related issue.

@dmajda dmajda closed this as completed Jan 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants