Skip to content

Commit 4618306

Browse files
committed
rfc, cfg-path-version: fix formal grammar to correspond to guide.
1 parent 40bc0f5 commit 4618306

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

text/0000-cfg-path-version.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,12 @@ However, there will be features in the future to use this mechanism on.
227227
## `#[cfg(version(<semver>))]`
228228

229229
To the `cfg` attribute, a `version` flag is added.
230-
This flag requires that a string literal be specified in it inside parenthesis.
231-
The string literal must have the format:
230+
This flag has the following grammar (where `\d` is any digit in `0` to `9`):
232231

233-
```
234-
semver : \d(.\d)?(.\d)? ;
232+
```rust
233+
flag : "version" "(" semver ")" ;
234+
semver : digits ("." digits ("." digits)?)? ;
235+
digits : \d+ ;
235236
```
236237

237238
[caret requirements]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#caret-requirements

0 commit comments

Comments
 (0)