forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rust-lang#253 from matthewjasper/identifier-and-ke…
…ywords Split identifiers from keywords or identifiers
- Loading branch information
Showing
3 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
# Identifiers | ||
|
||
> **<sup>Lexer:<sup>** | ||
> IDENTIFIER : | ||
> IDENTIFIER_OR_KEYWORD : | ||
> [`a`-`z` `A`-`Z`] [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>\*</sup> | ||
> | `_` [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>+</sup> | ||
> | ||
> IDENTIFIER : | ||
> IDENTIFIER_OR_KEYWORD <sub>*Except a [strict] or [reserved] keyword*</sub> | ||
An identifier is any nonempty ASCII string of the following form: | ||
|
||
Either | ||
|
||
* The first character is a letter | ||
* The remaining characters are alphanumeric or `_` | ||
* The first character is a letter. | ||
* The remaining characters are alphanumeric or `_`. | ||
|
||
Or | ||
|
||
* The first character is `_` | ||
* The identifier is more than one character, `_` alone is not an identifier | ||
* The remaining characters are alphanumeric or `_` | ||
* The first character is `_`. | ||
* The identifier is more than one character. `_` alone is not an identifier. | ||
* The remaining characters are alphanumeric or `_`. | ||
|
||
[strict]: keywords.html#strict-keywords | ||
[reserved]: keywords.html#reserved-keywords |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters