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

Add note on binding power of numeric quantifiers #1507

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ Each item is one of:
* `item ~ n` - Exactly *n* instances of item
* `item ~ n..m` - Between *n* to *m* instances of item (not recommended for wide ranges, due to performance issues)

Despite `~ n` being written with spaces, its binding power is the same as that of other operators,
for instance `a b ~ 3` parses as `a (b ~ 4)`, and `a ~ 2 b ~ 3` is parsed as `(a ~ 2) (b ~ 3)`.

**Examples:**
```perl
hello_world: "hello" "world"
Expand Down