Update scanner tests to work with new test infrastructure
This commit is contained in:
parent
dd55a6f7ac
commit
2cfe46389d
3 changed files with 92 additions and 58 deletions
|
@ -6,48 +6,64 @@ split-lines: true
|
||||||
|
|
||||||
The most simple identifiers are those made out of ASCII letters:
|
The most simple identifiers are those made out of ASCII letters:
|
||||||
|
|
||||||
Foo
|
```
|
||||||
Bar
|
Foo
|
||||||
Baz
|
Bar
|
||||||
|
Baz
|
||||||
|
```
|
||||||
|
|
||||||
However, they may also contain digits as long as they do not begin with a
|
However, they may also contain digits as long as they do not begin with a
|
||||||
digit:
|
digit:
|
||||||
|
|
||||||
Var1
|
```
|
||||||
Var2
|
Var1
|
||||||
Var10029384
|
Var2
|
||||||
|
Var10029384
|
||||||
|
```
|
||||||
|
|
||||||
Identifiers may be as long as you want:
|
Identifiers may be as long as you want:
|
||||||
|
|
||||||
ThisIsALongAndValidIdentifier
|
```
|
||||||
ThisIsAnEvenLongButStilCompletelyValidIdentifier
|
ThisIsALongAndValidIdentifier
|
||||||
|
ThisIsAnEvenLongerButStilCompletelyValidIdentifier
|
||||||
|
```
|
||||||
|
|
||||||
Moreover, they may have arbitrary underscores (`_`) in their names.
|
Moreover, they may have arbitrary underscores (`_`) in their names.
|
||||||
|
|
||||||
a_valid_identifier
|
```
|
||||||
another__0000__valid_identfier
|
a_valid_identifier
|
||||||
_1
|
another__0000__valid_identfier
|
||||||
__2
|
_1
|
||||||
___3
|
__2
|
||||||
|
___3
|
||||||
|
```
|
||||||
|
|
||||||
They may even be nothing more than underscores:
|
They may even be nothing more than underscores:
|
||||||
|
|
||||||
_
|
```
|
||||||
__
|
_
|
||||||
___
|
__
|
||||||
|
___
|
||||||
|
```
|
||||||
|
|
||||||
All identifiers starting with a `ID_Start` character are valid identifiers,
|
All identifiers starting with a `ID_Start` character are valid identifiers,
|
||||||
including `Other_ID_Start`:
|
including `Other_ID_Start`:
|
||||||
|
|
||||||
℘rototype
|
```
|
||||||
℮llipsis
|
℘rototype
|
||||||
|
℮llipsis
|
||||||
|
```
|
||||||
|
|
||||||
Likewise, the following code points using `Other_ID_Continue` are also valid:
|
Likewise, the following code points using `Other_ID_Continue` are also valid:
|
||||||
|
|
||||||
α·β
|
```
|
||||||
ano·teleia
|
α·β
|
||||||
|
ano·teleia
|
||||||
|
```
|
||||||
|
|
||||||
And, of course, the combination of `ID_Start` and `ID_Continue`:
|
And, of course, the combination of `ID_Start` and `ID_Continue`:
|
||||||
|
|
||||||
alfa·beta
|
```
|
||||||
|
alfa·beta
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,21 @@ split-lines: true
|
||||||
|
|
||||||
A string may hold arbirary ASCII characters, including spaces:
|
A string may hold arbirary ASCII characters, including spaces:
|
||||||
|
|
||||||
"Foo!"
|
```
|
||||||
"Once upon a time ..."
|
"Foo!"
|
||||||
|
"Once upon a time ..."
|
||||||
|
```
|
||||||
|
|
||||||
Special ASCII characters have no effect, other than that they are appended to
|
Special ASCII characters have no effect, other than that they are appended to
|
||||||
the contents of the string:
|
the contents of the string:
|
||||||
|
|
||||||
"S+me w3!rd @SCII ch@r$"
|
```
|
||||||
|
"S+me w3!rd @SCII ch@r$"
|
||||||
|
```
|
||||||
|
|
||||||
Some special escape sequences:
|
Some special escape sequences:
|
||||||
|
|
||||||
"\n\r"
|
```
|
||||||
"\n"
|
"\n\r"
|
||||||
|
"\n"
|
||||||
|
```
|
||||||
|
|
|
@ -6,52 +6,64 @@ split-lines: true
|
||||||
|
|
||||||
All decimal digits are valid integers.
|
All decimal digits are valid integers.
|
||||||
|
|
||||||
1
|
```
|
||||||
2
|
1
|
||||||
3
|
2
|
||||||
4
|
3
|
||||||
5
|
4
|
||||||
6
|
5
|
||||||
7
|
6
|
||||||
8
|
7
|
||||||
9
|
8
|
||||||
0
|
9
|
||||||
|
0
|
||||||
|
```
|
||||||
|
|
||||||
Any combination of decimal digits are valid integers, including integers
|
Any combination of decimal digits are valid integers, including integers
|
||||||
prefixed with an abirary amount of zeroes.
|
prefixed with an abirary amount of zeroes.
|
||||||
|
|
||||||
12345
|
```
|
||||||
99
|
12345
|
||||||
10
|
99
|
||||||
01
|
10
|
||||||
000
|
01
|
||||||
0010
|
000
|
||||||
|
0010
|
||||||
|
```
|
||||||
|
|
||||||
In binary mode, integers are read in base-2.
|
In binary mode, integers are read in base-2.
|
||||||
|
|
||||||
0b0
|
```
|
||||||
0b1
|
0b0
|
||||||
0b10010
|
0b1
|
||||||
0b00100
|
0b10010
|
||||||
0b00000
|
0b00100
|
||||||
|
0b00000
|
||||||
|
```
|
||||||
|
|
||||||
This means the following expressions are invalid in binary mode:
|
This means the following expressions are invalid in binary mode:
|
||||||
|
|
||||||
0b20001
|
```
|
||||||
0b12345
|
0b20001
|
||||||
0b00003
|
0b12345
|
||||||
|
0b00003
|
||||||
|
```
|
||||||
|
|
||||||
In octal mode, integers are read in base-8.
|
In octal mode, integers are read in base-8.
|
||||||
|
|
||||||
0o0
|
```
|
||||||
0o00000
|
0o0
|
||||||
0o007
|
0o00000
|
||||||
0o706
|
0o007
|
||||||
0o12345
|
0o706
|
||||||
|
0o12345
|
||||||
|
```
|
||||||
|
|
||||||
This means the following expressions are invalid in octal mode:
|
This means the following expressions are invalid in octal mode:
|
||||||
|
|
||||||
0o8
|
```
|
||||||
0o9
|
0o8
|
||||||
0o123456789
|
0o9
|
||||||
|
0o123456789
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue