swiftlang / swiftlang/swift-experimental-string-processing

Bring pretty printer up to date

Open
#314 2 comments 0 reactions 1 assignee View on GitHub

@Azoy is already working on this.

Since May 6, 2022.

Dominant language
Swift
Stars
308
Forks
52
Avg merge
12h 45m
Merged PRs (30d)
2

Description

The pretty printer converts a Regex defined in syntax into a RegexBuilder-style one, but it isn't up to date with the latest changes. This needs to be brought up to date, ideally with a validator that can take a regex and some input/output data, convert the regex to builder style, and then validate that both regexes have the same behavior.

For example, #"(?P)\w+ \d{2,} -"# converts to

Group(/* TODO: changeMatchingOptions */) {
  Concatenation {
    /* TODO: assertions */
    OneOrMore(.eager) {
      .wordCharacter
    }
    "-"
  }
}

instead of

Regex {
  Anchor.startOfInput
  OneOrMore(.eager) {
    CharacterClass.wordCharacter
  }
  "-"
}.asciiOnlyCharacterClasses()

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.