Skip to content
This repository has been archived by the owner on Jan 21, 2019. It is now read-only.

Enhancement: Allow parsing one rule to fail cleanly #19

Open
Northern-Lights opened this issue Oct 17, 2017 · 1 comment
Open

Enhancement: Allow parsing one rule to fail cleanly #19

Northern-Lights opened this issue Oct 17, 2017 · 1 comment
Assignees

Comments

@Northern-Lights
Copy link
Contributor

When using func (p *Parser) Parse(text string), a rule that does not match the grammar exits the program with status 1. This is an example:

{"lexical":"error","line":"4","msg":"Line 4: illegal regex modifier ())"}exit status 1

It would be great if the method had this signature instead:

func (p *Parser) Parse(text string) error

If we could pass errors from the lexer up to this method, maybe we can ignore rules that do not compile without exiting the application.

@Xumeiquer Xumeiquer self-assigned this Oct 17, 2017
@Xumeiquer
Copy link
Member

Yeah, that's true. This is a feature I have in mind.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants