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:
|
||||
|
||||
Foo
|
||||
Bar
|
||||
Baz
|
||||
```
|
||||
Foo
|
||||
Bar
|
||||
Baz
|
||||
```
|
||||
|
||||
However, they may also contain digits as long as they do not begin with a
|
||||
digit:
|
||||
|
||||
Var1
|
||||
Var2
|
||||
Var10029384
|
||||
```
|
||||
Var1
|
||||
Var2
|
||||
Var10029384
|
||||
```
|
||||
|
||||
Identifiers may be as long as you want:
|
||||
|
||||
ThisIsALongAndValidIdentifier
|
||||
ThisIsAnEvenLongButStilCompletelyValidIdentifier
|
||||
```
|
||||
ThisIsALongAndValidIdentifier
|
||||
ThisIsAnEvenLongerButStilCompletelyValidIdentifier
|
||||
```
|
||||
|
||||
Moreover, they may have arbitrary underscores (`_`) in their names.
|
||||
|
||||
a_valid_identifier
|
||||
another__0000__valid_identfier
|
||||
_1
|
||||
__2
|
||||
___3
|
||||
```
|
||||
a_valid_identifier
|
||||
another__0000__valid_identfier
|
||||
_1
|
||||
__2
|
||||
___3
|
||||
```
|
||||
|
||||
They may even be nothing more than underscores:
|
||||
|
||||
_
|
||||
__
|
||||
___
|
||||
```
|
||||
_
|
||||
__
|
||||
___
|
||||
```
|
||||
|
||||
All identifiers starting with a `ID_Start` character are valid identifiers,
|
||||
including `Other_ID_Start`:
|
||||
|
||||
℘rototype
|
||||
℮llipsis
|
||||
```
|
||||
℘rototype
|
||||
℮llipsis
|
||||
```
|
||||
|
||||
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`:
|
||||
|
||||
alfa·beta
|
||||
```
|
||||
alfa·beta
|
||||
```
|
||||
|
||||
|
|
|
@ -6,15 +6,21 @@ split-lines: true
|
|||
|
||||
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
|
||||
the contents of the string:
|
||||
|
||||
"S+me w3!rd @SCII ch@r$"
|
||||
```
|
||||
"S+me w3!rd @SCII ch@r$"
|
||||
```
|
||||
|
||||
Some special escape sequences:
|
||||
|
||||
"\n\r"
|
||||
"\n"
|
||||
```
|
||||
"\n\r"
|
||||
"\n"
|
||||
```
|
||||
|
|
|
@ -6,52 +6,64 @@ split-lines: true
|
|||
|
||||
All decimal digits are valid integers.
|
||||
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
0
|
||||
```
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
0
|
||||
```
|
||||
|
||||
Any combination of decimal digits are valid integers, including integers
|
||||
prefixed with an abirary amount of zeroes.
|
||||
|
||||
12345
|
||||
99
|
||||
10
|
||||
01
|
||||
000
|
||||
0010
|
||||
```
|
||||
12345
|
||||
99
|
||||
10
|
||||
01
|
||||
000
|
||||
0010
|
||||
```
|
||||
|
||||
In binary mode, integers are read in base-2.
|
||||
|
||||
0b0
|
||||
0b1
|
||||
0b10010
|
||||
0b00100
|
||||
0b00000
|
||||
```
|
||||
0b0
|
||||
0b1
|
||||
0b10010
|
||||
0b00100
|
||||
0b00000
|
||||
```
|
||||
|
||||
This means the following expressions are invalid in binary mode:
|
||||
|
||||
0b20001
|
||||
0b12345
|
||||
0b00003
|
||||
```
|
||||
0b20001
|
||||
0b12345
|
||||
0b00003
|
||||
```
|
||||
|
||||
In octal mode, integers are read in base-8.
|
||||
|
||||
0o0
|
||||
0o00000
|
||||
0o007
|
||||
0o706
|
||||
0o12345
|
||||
```
|
||||
0o0
|
||||
0o00000
|
||||
0o007
|
||||
0o706
|
||||
0o12345
|
||||
```
|
||||
|
||||
This means the following expressions are invalid in octal mode:
|
||||
|
||||
0o8
|
||||
0o9
|
||||
0o123456789
|
||||
```
|
||||
0o8
|
||||
0o9
|
||||
0o123456789
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue