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

Clarify README: Does participle support custom lexers or not? #180

Closed
stevegt opened this issue Sep 15, 2021 · 3 comments · Fixed by #181
Closed

Clarify README: Does participle support custom lexers or not? #180

stevegt opened this issue Sep 15, 2021 · 3 comments · Fixed by #181

Comments

@stevegt
Copy link
Contributor

stevegt commented Sep 15, 2021

The README discusses writing custom lexers, but then later says "The Stateful lexer is now the only custom lexer supported by Participle".

Makes it sound like there's been a recent code change that prevents using custom lexers with participle. Is writing your own custom lexer (e.g. indent-based as in #20) still supported?

@stevegt
Copy link
Contributor Author

stevegt commented Sep 15, 2021

'git blame' says both of those sections were added in the same commit... would it be correct to change "now the only custom lexer supported by Participle" to "now the only custom lexer included with Participle"?

@alecthomas
Copy link
Owner

Sure, sounds reasonable. PRs welcome.

@stevegt
Copy link
Contributor Author

stevegt commented Sep 16, 2021

Will do. Trying to come up with accurate wording while looking through 362b266 and current, it looks like there is no longer a way to define a grammar using EBNF without writing your own custom lexer -- Stateful only accepts regex-style rules, right?

stevegt added a commit to stevegt/participle that referenced this issue Sep 16, 2021
- fixes alecthomas#180
- make it clear custom lexers are fully supported
- indentation lexers are implementable
- stateful replaced regex
- EBNF lexer removed -- callers need to implement their own EBNF lexer
alecthomas pushed a commit that referenced this issue Sep 17, 2021
- fixes #180
- make it clear custom lexers are fully supported
- indentation lexers are implementable
- stateful replaced regex
- EBNF lexer removed -- callers need to implement their own EBNF lexer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants