Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[package]
name = "ungrammar"
description = "A DSL for describing concrete syntax trees"
version = "1.14.3"
version = "1.14.4"
license = "MIT OR Apache-2.0"
repository = "https://github.com/matklad/ungrammar"
authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
edition = "2018"

exclude = ["/bors.toml", "/.github"]
Expand Down
7 changes: 6 additions & 1 deletion rust.ungram
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,12 @@ WildcardPat =
'_'

RangePat =
start:Pat op:('..' | '..=') end:Pat
// 1..
start:Pat op:('..' | '..=')
// 1..2
| start:Pat op:('..' | '..=') end:Pat
// ..2
| op:('..' | '..=') end:Pat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fold this into the same case, like we did for RangeExpr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are slightly semantically different: what I wrote here is 1..2 or 1.. or ..2 but not ... rustc will syntax error if you put .., although it will tell you what you did wrong:

error: `..` patterns are not allowed here
 --> src/main.rs:3:9
  |
3 |         .. => 4,
  |         ^^
  |
  = note: only allowed in tuple, tuple struct, and slice patterns


RefPat =
'&' 'mut'? Pat
Expand Down