-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support into octal and binary literals * Add hex support * And finally support all numeric literals and fix spelling * Update error message * Refactor error in scanner to take a position * Scan no separators in escape sequences, add escape sequence tests * More decimal tests from the spec presentation examples * Permissive scanning of excess separators * Remove unnecessary assignment * Make code easier to follow
- Loading branch information
Showing
45 changed files
with
2,834 additions
and
22 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
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
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
12 changes: 12 additions & 0 deletions
12
tests/baselines/reference/parser.numericSeparators.binary.js
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//// [parser.numericSeparators.binary.ts] | ||
0b00_11; | ||
0B0_1; | ||
0b1100_0011; | ||
0B0_11_0101; | ||
|
||
|
||
//// [parser.numericSeparators.binary.js] | ||
3; | ||
1; | ||
195; | ||
53; |
7 changes: 7 additions & 0 deletions
7
tests/baselines/reference/parser.numericSeparators.binary.symbols
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
=== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/parser.numericSeparators.binary.ts === | ||
0b00_11; | ||
No type information for this code.0B0_1; | ||
No type information for this code.0b1100_0011; | ||
No type information for this code.0B0_11_0101; | ||
No type information for this code. | ||
No type information for this code. |
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/parser.numericSeparators.binary.types
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/parser.numericSeparators.binary.ts === | ||
0b00_11; | ||
>0b00_11 : 3 | ||
|
||
0B0_1; | ||
>0B0_1 : 1 | ||
|
||
0b1100_0011; | ||
>0b1100_0011 : 195 | ||
|
||
0B0_11_0101; | ||
>0B0_11_0101 : 53 | ||
|
50 changes: 50 additions & 0 deletions
50
tests/baselines/reference/parser.numericSeparators.binaryNegative.errors.txt
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts(1,5): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts(1,3): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,2): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS1005: ';' expected. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts(1,3): error TS2304: Cannot find name 'B0101'. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts(1,6): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts(1,13): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,3): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,4): error TS6188: Numeric separators are not allowed here. | ||
tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts(1,5): error TS6188: Numeric separators are not allowed here. | ||
|
||
|
||
==== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/1.ts (1 errors) ==== | ||
0b00_ | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
|
||
==== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/2.ts (1 errors) ==== | ||
0b_110 | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
|
||
==== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/3.ts (3 errors) ==== | ||
0_B0101 | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
~~~~~ | ||
!!! error TS1005: ';' expected. | ||
~~~~~ | ||
!!! error TS2304: Cannot find name 'B0101'. | ||
|
||
==== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/4.ts (1 errors) ==== | ||
0b01__11 | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
|
||
==== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/5.ts (1 errors) ==== | ||
0B0110_0110__ | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
|
||
==== tests/cases/conformance/parser/ecmascriptnext/numericSeparators/6.ts (3 errors) ==== | ||
0b___0111010_0101_1 | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
~ | ||
!!! error TS6188: Numeric separators are not allowed here. | ||
|
34 changes: 34 additions & 0 deletions
34
tests/baselines/reference/parser.numericSeparators.binaryNegative.js
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//// [tests/cases/conformance/parser/ecmascriptnext/numericSeparators/parser.numericSeparators.binaryNegative.ts] //// | ||
|
||
//// [1.ts] | ||
0b00_ | ||
|
||
//// [2.ts] | ||
0b_110 | ||
|
||
//// [3.ts] | ||
0_B0101 | ||
|
||
//// [4.ts] | ||
0b01__11 | ||
|
||
//// [5.ts] | ||
0B0110_0110__ | ||
|
||
//// [6.ts] | ||
0b___0111010_0101_1 | ||
|
||
|
||
//// [1.js] | ||
0; | ||
//// [2.js] | ||
6; | ||
//// [3.js] | ||
0; | ||
B0101; | ||
//// [4.js] | ||
7; | ||
//// [5.js] | ||
102; | ||
//// [6.js] | ||
1867; |
Oops, something went wrong.