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

Include batteries #49

Open
AndrasKovacs opened this issue Sep 24, 2023 · 0 comments
Open

Include batteries #49

AndrasKovacs opened this issue Sep 24, 2023 · 0 comments

Comments

@AndrasKovacs
Copy link
Owner

AndrasKovacs commented Sep 24, 2023

The idea is to have a TH-configurable interface that covers a lot of needed features in PL parsing. The inputs could be the following:

  • Identifier parsing: first character, rest of characters.
  • Whitespace characters.
  • Comments, line/multiline, nestedness.
  • List of keywords.
  • Type of errors, rendering possibly custom or configurable.

Output:

  • Identifier parser, keyword parser, whitespace parser, token combinator.
  • Functions for error handling.
  • switch function that automatically handles keyword/identifier disambiguation and tokenization. For example, if I switch on "let", I don't want to manually cover the case where we actually have an identifier that has "let" as prefix. This should be handled at compile time, by using the user-provided functions for identifier/keyword parsing. The source spans of switched things should be also made accessible in a concise way.

There could be two flavors of batteries, one for Basic without indentation tracking an another for Stateful with it. There should be at least a larger PL benchmark too that uses our batteries. That could also serve as tutorial.

I'm interested in suggestions about what kind of features could be included in the batteries.

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

No branches or pull requests

1 participant