2020-06-07 00:21:15 +02:00
|
|
|
|
---
|
|
|
|
|
type: scan
|
|
|
|
|
expect: BoltIdentifier
|
|
|
|
|
split-lines: true
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
The most simple identifiers are those made out of ASCII letters:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
Foo
|
|
|
|
|
Bar
|
|
|
|
|
Baz
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
However, they may also contain digits as long as they do not begin with a
|
|
|
|
|
digit:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
Var1
|
|
|
|
|
Var2
|
|
|
|
|
Var10029384
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
Identifiers may be as long as you want:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
ThisIsALongAndValidIdentifier
|
|
|
|
|
ThisIsAnEvenLongerButStilCompletelyValidIdentifier
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
Moreover, they may have arbitrary underscores (`_`) in their names.
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
a_valid_identifier
|
|
|
|
|
another__0000__valid_identfier
|
|
|
|
|
_1
|
|
|
|
|
__2
|
|
|
|
|
___3
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
They may even be nothing more than underscores:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
_
|
|
|
|
|
__
|
|
|
|
|
___
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
All identifiers starting with a `ID_Start` character are valid identifiers,
|
|
|
|
|
including `Other_ID_Start`:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
℘rototype
|
|
|
|
|
℮llipsis
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
Likewise, the following code points using `Other_ID_Continue` are also valid:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
α·β
|
|
|
|
|
ano·teleia
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|
|
|
|
|
And, of course, the combination of `ID_Start` and `ID_Continue`:
|
|
|
|
|
|
2020-06-13 19:30:14 +02:00
|
|
|
|
```
|
|
|
|
|
alfa·beta
|
|
|
|
|
```
|
2020-06-07 00:21:15 +02:00
|
|
|
|
|