AndrasKovacs / AndrasKovacs/flatparse

Include batteries

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
178
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. First inspect the existing parser API and determine how the proposed Basic and Stateful batteries would fit; completion would require an agreed feature scope, implementations for the listed parsing and error-handling capabilities, and a PL benchmark or tutorial.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.