pest-parser / pest-parser/pest

More useful built-in rules

Open
#306 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement generator
Dominant language
Rust
Stars
5.4k
Forks
307
Avg merge
8h 23m
Merged PRs (30d)
5

Description

List of built-in rules is rather short. There can be:

  • A rule for floating-point number like +34.12e+56
  • A rule for some integer number like 123 or 0x24AE.
  • A string literal like "qwe\\dfg\"zxc"
  • An identifier beginning with a letter or underscore and containing letters, digits and underscore
  • ISO datetime

Explicitly writing such rules each time those blocks are needed makes grammars less readable and more error-prone. Also availability of common building blocks discourages being too inventive about grammars (like designing you own escaping scheme for strings) without reason.

So popular and useful rules should be available at hand, either as built-in rules or importable from external crate like pest-common-rules and mentioned in the book.

JSON example in the book should contain additional "final version" of the grammar, where string and number are replaced by STRING_LITERAL and FLOATING_POINT_NUMBER built-ins.

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.

Research direction

Start with the linked list of built-in rules and the JSON example in the book. Determine which proposed floating-point, integer, string-literal, identifier, and ISO datetime rules are supported and how they should be exposed, then update the JSON example so its string and number rules use the selected built-ins.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.