Skip to content

v7 proposals #118

Closed
Closed
@jamesdbrock

Description

@jamesdbrock

Here are some things I would like to see in v7 of this package.

The target design space for this package should be similar to MegaParsec: intended for users who prefer correctness and feature-completeness to speed. Anyone who wants speed in a V8 runtime environment will use the built-in Regex.

Text.Parsing.Parser

-- | Contains the remaining input and current position.
data ParseState s = ParseState s Position Boolean

Change the definition of ParseState so that we can have cursor-based state in parsers, and so that line-column state is optional.

Tracking the newline-based line and column position is an important feature but it’s expensive and rarely-used. I would like to try to make that optional.

  1. I'd like to switch to a cursor-based state for String parsers, instead of a state which tracks “the remaining input”.

Do we need the Boolean “consumed flag” in the ParseState? As far as I can tell this is set but never tested. Nothing cares what the “consumed flag” value is?

  1. Make the Position zero-based. Position line and column should start at zero #94
data ParseState s state = ParseState s state

Text.Parsing.Parser.Combinators

  1. Add combinators manyTill, many1Till_ manyTill_ combinator #108

Text.Parsing.Parser.String

  1. UTF-16 correctness. We should always handle UTF-16 surrogate paris correctly, and that means always treating token as CodePoint instead of CodeUnit. CodePoints uncons? Deprecate drop? #109
  2. Delete the StringLike typeclass. Has anyone ever created an instance of this class for a type other than String?
  3. Add combinator match match combinator #107

Text.Parsing.Parser.DataView

  1. Add DataView parsing to this package? Merge this repo into purescript-parsing? rowtype-yoga/purescript-parsing-dataview#10

Module names

  1. Remove the Text. prefix from all module names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions