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

Partial match feature #646

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Partial match feature #646

wants to merge 2 commits into from

Conversation

Seb35
Copy link

@Seb35 Seb35 commented Apr 2, 2020

A partial match will succeed if at least the first part of input string matches: it does not fail in the case there are remaining unconsumed characters.

Note it fails in the case the start rule fails: if the grammar author want not to fail in this case, the start rule can be surrounded by a "?".

PR type

  • Bug fix (non-breaking change which fixes an issue): no
  • New feature (non-breaking change which adds functionality): yes
  • Breaking change (fix or feature that would cause existing functionality to change): no
  • Documentation change: add an option either for grammar generation either for grammar execution

Prerequisites

  • I have read the CONTRIBUTING.md document: yes
  • I have updated the documentation accordingly: not yet
  • I have added tests to cover my changes: not yet

Description

The option partialMatch added in this commit fix the behaviour for every execution of the grammar. After thinking about it, I find it should be allowed to change this behaviour at execution time, so this PR should be changed accordingly (if this is shared by others).

Complete description in #645

A partial match will succeed if at least the first part of input
string matches: it does not fail in the case there are remaining
unconsumed characters.

Note it fails in the case the start rule fails: if the grammar
author want not to fail in this case, the start rule can be
surrounded by a "?".
@vercel
Copy link

vercel bot commented Apr 2, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/peg-js/pegjs/k08b4d5l5
✅ Preview: https://pegjs-git-fork-seb35-dev-partialmatch.peg-js.now.sh

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

Successfully merging this pull request may close these issues.

None yet

1 participant