diff --git a/es2panda/test/parser/ts/test-arrow-function-expected.txt b/es2panda/test/parser/ts/test-arrow-function-expected.txt deleted file mode 100644 index 3b1c99fad1d98eae99807a0b0ac4aab9008a6598..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function-expected.txt +++ /dev/null @@ -1,357 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "y", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 13 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 3 - } - } - }, - { - "type": "Identifier", - "name": "y", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 14 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 2 - }, - "end": { - "line": 19, - "column": 3 - } - } - }, - { - "type": "Identifier", - "name": "y", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "z", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 25 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 40 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 44 - } - } -} diff --git a/es2panda/test/parser/ts/test-arrow-function.ts b/es2panda/test/parser/ts/test-arrow-function.ts deleted file mode 100644 index f63f613709bd7aeab0497407fa99fca624839da3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -(y?: number) => { } -(x: number, y?: number) => { }; -(x: number, y: number, z?: boolean) => { }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-arrow-function1-expected.txt b/es2panda/test/parser/ts/test-arrow-function1-expected.txt deleted file mode 100644 index b63e9879dfe0bd549f6268e6eb6dab17956ece8f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function1-expected.txt +++ /dev/null @@ -1,174 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [], - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "body": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 40 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-arrow-function1.ts b/es2panda/test/parser/ts/test-arrow-function1.ts deleted file mode 100644 index 36780a4d9a151fb38eb1741da7795e623de566af..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const f = (): (() => number) => () => 1; diff --git a/es2panda/test/parser/ts/test-arrow-function2-expected.txt b/es2panda/test/parser/ts/test-arrow-function2-expected.txt deleted file mode 100644 index 32acf8e35f0c56a1465de77ac46f5756c1c3c640..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function2-expected.txt +++ /dev/null @@ -1,372 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 20 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 32 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-arrow-function2.ts b/es2panda/test/parser/ts/test-arrow-function2.ts deleted file mode 100644 index d74b83728600dca478cdc507d1bde9905cca9807..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function2.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C { - a : number = 0; -} -var b = () => ((({ a: 1 }))); - diff --git a/es2panda/test/parser/ts/test-arrow-function3-expected.txt b/es2panda/test/parser/ts/test-arrow-function3-expected.txt deleted file mode 100644 index 886d37f2427e8df501f31f05efea83fe8eab3177..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function3-expected.txt +++ /dev/null @@ -1,287 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 23 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "ConditionalExpression", - "test": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "consequent": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "alternate": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 13 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 19 - } - } -} diff --git a/es2panda/test/parser/ts/test-arrow-function3.ts b/es2panda/test/parser/ts/test-arrow-function3.ts deleted file mode 100644 index 571ebe40a12063448e2881c1c3d5e02874ee27ef..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-arrow-function3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a : boolean = true; -var b = (a ? 1 : 2) -var c = (a?) => {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-as-expression-expected.txt b/es2panda/test/parser/ts/test-as-expression-expected.txt deleted file mode 100644 index 3af6025350b21632171ee95a9d4e03f5dc722a94..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-as-expression.ts:17:13] diff --git a/es2panda/test/parser/ts/test-as-expression.ts b/es2panda/test/parser/ts/test-as-expression.ts deleted file mode 100644 index fcb85d0f33cf75511feee903ee13af3e86bc5c95..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 5 as; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-as-expression1-expected.txt b/es2panda/test/parser/ts/test-as-expression1-expected.txt deleted file mode 100644 index 7bbbe5a75efcbb68c5ab30be0a8070233cf540b3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression1-expected.txt +++ /dev/null @@ -1,353 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 17, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "state", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "init": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 17 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - { - "type": "IfStatement", - "test": { - "type": "Identifier", - "name": "state", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - "arguments": [ - { - "type": "LogicalExpression", - "operator": "&&", - "left": { - "type": "TSAsExpression", - "expression": { - "type": "Identifier", - "name": "state", - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "right": { - "type": "Identifier", - "name": "state", - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 29 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-as-expression1.ts b/es2panda/test/parser/ts/test-as-expression1.ts deleted file mode 100644 index 12faa28573bd2275b0278551421e43e82a00ac1d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression1.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function test(x: boolean): boolean { return x; } - -let state = true; - -if (state) { - test(state as any && state); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-as-expression2-expected.txt b/es2panda/test/parser/ts/test-as-expression2-expected.txt deleted file mode 100644 index 0a4a079592a0434b27b29539250cdc300c549269..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression2-expected.txt +++ /dev/null @@ -1,317 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "as", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "obj", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 12 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 12 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "as", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 5 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-as-expression2.ts b/es2panda/test/parser/ts/test-as-expression2.ts deleted file mode 100644 index 91fd93dbf847aca8450282adafe15ba048ebd628..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo() {} -function as(obj) {} - -var B = foo; -var x = foo -as(B) diff --git a/es2panda/test/parser/ts/test-as-expression3-expected.txt b/es2panda/test/parser/ts/test-as-expression3-expected.txt deleted file mode 100644 index 6095e8c447c240e3388dac4f45e88cfb0a35405d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression3-expected.txt +++ /dev/null @@ -1,561 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a1", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 21 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a2", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a3", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "value": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a4", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 22 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a5", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "init": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 20 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-as-expression3.ts b/es2panda/test/parser/ts/test-as-expression3.ts deleted file mode 100644 index 0d584074ed2ad42430f6926c2fd8133e9c4cd6a4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression3.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a1 = 1 as const; -var a2 = (1 as const); -var a3 = {b : 1 as const}; -var a4 = [1 as const]; -var a5 = 1; diff --git a/es2panda/test/parser/ts/test-as-expression4-expected.txt b/es2panda/test/parser/ts/test-as-expression4-expected.txt deleted file mode 100644 index d1b6928df7109382bdc6b6fe388326909e6825c9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-as-expression4.ts:17:20] diff --git a/es2panda/test/parser/ts/test-as-expression4.ts b/es2panda/test/parser/ts/test-as-expression4.ts deleted file mode 100644 index e226bfdc27f5a2c59f171bafc4fe1d68d212b90e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 1 as const b; diff --git a/es2panda/test/parser/ts/test-as-expression5-expected.txt b/es2panda/test/parser/ts/test-as-expression5-expected.txt deleted file mode 100644 index 01b1d76c597d9be789acbe5a3666fbca896bed12..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Primary expression expected [test-as-expression5.ts:17:20] diff --git a/es2panda/test/parser/ts/test-as-expression5.ts b/es2panda/test/parser/ts/test-as-expression5.ts deleted file mode 100644 index fe2c2086ba7d20dd74345038d3140b221e06fea2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 1 as const?; diff --git a/es2panda/test/parser/ts/test-as-expression6-expected.txt b/es2panda/test/parser/ts/test-as-expression6-expected.txt deleted file mode 100644 index 771c79d2234eaaa51e7404eff3de6e788c4396a8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-as-expression6.ts:17:19] diff --git a/es2panda/test/parser/ts/test-as-expression6.ts b/es2panda/test/parser/ts/test-as-expression6.ts deleted file mode 100644 index ed08243726b16bd731f2ca9cc069ab1b5eef6e0c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 1 as const.b; diff --git a/es2panda/test/parser/ts/test-as-expression7-expected.txt b/es2panda/test/parser/ts/test-as-expression7-expected.txt deleted file mode 100644 index b028b1d3b84c38aa87d1a78f1aee037dc84e22ee..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Invalid left-hand side operator. [test-as-expression7.ts:17:20] diff --git a/es2panda/test/parser/ts/test-as-expression7.ts b/es2panda/test/parser/ts/test-as-expression7.ts deleted file mode 100644 index b6ff7fb657649d5876dd8c7c2a2a979fb6c4b659..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -++((a+b) as number); diff --git a/es2panda/test/parser/ts/test-as-expression8-expected.txt b/es2panda/test/parser/ts/test-as-expression8-expected.txt deleted file mode 100644 index 0e041f2987fc2ee11d3e1d5b669c3b8f31bf4cde..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression8-expected.txt +++ /dev/null @@ -1,181 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "left", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 18, - "column": 6 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "right", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 24 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 24 - } - } -} diff --git a/es2panda/test/parser/ts/test-as-expression8.ts b/es2panda/test/parser/ts/test-as-expression8.ts deleted file mode 100644 index bd50d61612adcc5599d8ed941ed8c236acf51bb7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-as-expression8.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const left = {} as any -const right = {} as any \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-1-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-1-expected.txt deleted file mode 100644 index 8c5d8ad384e07b9c3a313316e16a354085cf982f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-class-auto-accessor-1.ts:18:20] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-1.ts b/es2panda/test/parser/ts/test-class-auto-accessor-1.ts deleted file mode 100644 index c0c413ca3140cffbae0d2ebc88a0f69c9a454f8a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - static declare accessor member:string = "str"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-2-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-2-expected.txt deleted file mode 100644 index c0f1d3d2c5b478bc6b3fc5348c10f92b942dfa37..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An auto accessor property can't be declared optional. [test-class-auto-accessor-2.ts:18:27] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-2.ts b/es2panda/test/parser/ts/test-class-auto-accessor-2.ts deleted file mode 100644 index c4e473691a886fbdf7b64e4d5f316272d24bb444..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - static accessor member?:string = "str"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-3-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-3-expected.txt deleted file mode 100644 index fd580577e67f9c0fb625e19399f69c3b09307bd6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-class-auto-accessor-3.ts:18:21] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-3.ts b/es2panda/test/parser/ts/test-class-auto-accessor-3.ts deleted file mode 100644 index 64237cdfe6eca85e52241f35f8fe85548f5de0da..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - static readonly accessor member:string = "str"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-4-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-4-expected.txt deleted file mode 100644 index 84b637b6344d27d0d69cc94f0a4f90f8989f3a73..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-class-auto-accessor-4.ts:18:14] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-4.ts b/es2panda/test/parser/ts/test-class-auto-accessor-4.ts deleted file mode 100644 index 458332559d69d6b0855f90b8aec5520bebf3dfa9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - readonly accessor member:string = "str"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-5-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-5-expected.txt deleted file mode 100644 index 074e9b7e221dacbedcd0734d02967456f562e98c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An auto accessor property can't be declared optional. [test-class-auto-accessor-5.ts:18:20] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-5.ts b/es2panda/test/parser/ts/test-class-auto-accessor-5.ts deleted file mode 100644 index 4c301d4b47bb03c8684cd0a90b9edde0485d9784..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-5.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - accessor member?:string = "str"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-6-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-6-expected.txt deleted file mode 100644 index b83cbdbe245f8fe72f1b24e051e58690c094e874..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-class-auto-accessor-6.ts:18:13] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-6.ts b/es2panda/test/parser/ts/test-class-auto-accessor-6.ts deleted file mode 100644 index 4c5009aa2528189313d890d976684b6d5e89b095..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-6.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - declare accessor member:string = "str"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-7-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-7-expected.txt deleted file mode 100644 index e680c6315907da02ebd24c61fff83b4e769665b3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not available for auto accessor property now. [test-class-auto-accessor-7.ts:22:14] diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-7.ts b/es2panda/test/parser/ts/test-class-auto-accessor-7.ts deleted file mode 100644 index 0aae5751529243139243030db8702a5f5311822e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-7.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function dec(target:any, prop:any) { -} - -class A { - @dec - accessor name:string = "1" -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-8-expected.txt b/es2panda/test/parser/ts/test-class-auto-accessor-8-expected.txt deleted file mode 100644 index 19a63932f56dd89c82216ea55b5b60ceb4b6f827..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-8-expected.txt +++ /dev/null @@ -1,271 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-auto-accessor-8.ts b/es2panda/test/parser/ts/test-class-auto-accessor-8.ts deleted file mode 100644 index 32dacafb4c5af5fb127de6556d5b26c58c1bc599..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-auto-accessor-8.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C1 { - accessor #b = 1; - constructor() { - this.#b = 4; - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-constructor-expected.txt b/es2panda/test/parser/ts/test-class-constructor-expected.txt deleted file mode 100644 index 28cde7a0a731658d16baed18f36b451a536f2712..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor-expected.txt +++ /dev/null @@ -1,742 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Baz", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - { - "type": "Identifier", - "name": "n", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 39 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 30 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "right": { - "type": "LogicalExpression", - "operator": "||", - "left": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "", - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "right": { - "type": "LogicalExpression", - "operator": "||", - "left": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 41 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 29, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor.ts b/es2panda/test/parser/ts/test-class-constructor.ts deleted file mode 100644 index 4d6e46921d9dd0b8bbccdbd965840f09afcdf270..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Baz { - s: string; - n: number; - constructor(s?: string, n?: number) { - this.s = s || ""; - this.n = n || 0; - this.f(); - }; - f(): void { - this.n++; - }; -} diff --git a/es2panda/test/parser/ts/test-class-constructor1-expected.txt b/es2panda/test/parser/ts/test-class-constructor1-expected.txt deleted file mode 100644 index 0c9cd3e40cecae0f527cd4979865aa6a3fe06bc4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructor implementation is missing. [test-class-constructor1.ts:20:5] diff --git a/es2panda/test/parser/ts/test-class-constructor1.ts b/es2panda/test/parser/ts/test-class-constructor1.ts deleted file mode 100644 index 439762c98f810d4876252cebc7d51e773d97e686..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor1.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(); - a: string; - constructor() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-constructor10-expected.txt b/es2panda/test/parser/ts/test-class-constructor10-expected.txt deleted file mode 100644 index d27350d89479643ff33991f466b785bff748c792..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A super call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers. [test-class-constructor10.ts:20:5] diff --git a/es2panda/test/parser/ts/test-class-constructor10.ts b/es2panda/test/parser/ts/test-class-constructor10.ts deleted file mode 100644 index 1297343a1768b1f45c8c507097c05de8f1940a45..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor10.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { } -class A extends Base { - prop: number = 1; - constructor() { - print("hello"); - if (true) { super() } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor11-expected.txt b/es2panda/test/parser/ts/test-class-constructor11-expected.txt deleted file mode 100644 index ae1afcb54bb46111d1fcf922b804b2c339253894..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor11-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A super call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers. [test-class-constructor11.ts:19:5] diff --git a/es2panda/test/parser/ts/test-class-constructor11.ts b/es2panda/test/parser/ts/test-class-constructor11.ts deleted file mode 100644 index aae0526d9027255ce0a259c70591d9f14a55a89f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor11.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { } -class A extends Base { - constructor(public prop: number) { - print("hello"); - while(true) { - var a = super(); - } - - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor12-expected.txt b/es2panda/test/parser/ts/test-class-constructor12-expected.txt deleted file mode 100644 index 07b186146ce43c5777c2fa275fb05134711cc851..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor12-expected.txt +++ /dev/null @@ -1,852 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 22 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "TSParameterProperty", - "accessibility": "undefined", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "prop", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 30 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "super", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "xxx", - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 33 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 29 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 14 - } - } - }, - "init": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "thisParam": { - "type": "Identifier", - "name": "this", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 22, - "column": 33 - }, - "end": { - "line": 22, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 38 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 24, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "thisParam": { - "type": "Identifier", - "name": "this", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 20 - }, - "end": { - "line": 25, - "column": 24 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 26, - "column": 20 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 31 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 14 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 40 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 31, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 32, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor12.ts b/es2panda/test/parser/ts/test-class-constructor12.ts deleted file mode 100644 index 12af834258d1633e7ee7b681ab02238ef9b0778f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor12.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { prop = 1 } -class A extends Base { - constructor(readonly prop: number) { - var a = { super: "xxx" }; - const b = () => this; - var c = function (this: any) { - return this; - } - function f(this: any) { - return this; - } - - super(); - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor13-expected.txt b/es2panda/test/parser/ts/test-class-constructor13-expected.txt deleted file mode 100644 index 6d83adbe60367c404a156469ef091fc580130568..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor13-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: super() must be called before this/super access. [test-class-constructor13.ts:20:5] diff --git a/es2panda/test/parser/ts/test-class-constructor13.ts b/es2panda/test/parser/ts/test-class-constructor13.ts deleted file mode 100644 index ba264b0d4edfdef5de13529f08ca1e0c3215eba0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor13.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { } -class A extends Base { - name: number; - constructor() { - this.name = 1; - if (true) { super() } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor14-expected.txt b/es2panda/test/parser/ts/test-class-constructor14-expected.txt deleted file mode 100644 index 12fd24998b3d79b4cd2144ace3877c52c2bb2da5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor14-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructors for derived classes must contain a super call. [test-class-constructor14.ts:19:5] diff --git a/es2panda/test/parser/ts/test-class-constructor14.ts b/es2panda/test/parser/ts/test-class-constructor14.ts deleted file mode 100644 index fe2dc24900f5873d6c7cf7cececb65e944093b93..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor14.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { } -class A extends Base { - constructor() { - let a = "hello"; - print(a); - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor15-expected.txt b/es2panda/test/parser/ts/test-class-constructor15-expected.txt deleted file mode 100644 index 30ef365866e2a812b83083cbd3042c4a407cee01..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor15-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A constructor cannot contain a super call when its class extends null. [test-class-constructor15.ts:18:5] diff --git a/es2panda/test/parser/ts/test-class-constructor15.ts b/es2panda/test/parser/ts/test-class-constructor15.ts deleted file mode 100644 index 5d814bce3d8c6463404ee4936a64700cc161cd95..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor15.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A extends null { - constructor() { - super(); - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor16-expected.txt b/es2panda/test/parser/ts/test-class-constructor16-expected.txt deleted file mode 100644 index ae4535ba558c9366f31235a98cf18ef090ba781b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor16-expected.txt +++ /dev/null @@ -1,150 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": { - "type": "NullLiteral", - "value": null, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor16.ts b/es2panda/test/parser/ts/test-class-constructor16.ts deleted file mode 100644 index 9c11fda8c0653fcff4b7b15ead0ba3ffb48ef442..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor16.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A extends null {} diff --git a/es2panda/test/parser/ts/test-class-constructor17-expected.txt b/es2panda/test/parser/ts/test-class-constructor17-expected.txt deleted file mode 100644 index 2a2c278af24f2a8bedc354969361d48430de88c9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor17-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructors for derived classes must contain a super call. [test-class-constructor17.ts:20:5] diff --git a/es2panda/test/parser/ts/test-class-constructor17.ts b/es2panda/test/parser/ts/test-class-constructor17.ts deleted file mode 100644 index abc26d83587f6c10816080be777a2756e1628849..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor17.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { } - -class D extends Base { - constructor() { - var a = class Inner extends Base { constructor() { super(); } } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor18-expected.txt b/es2panda/test/parser/ts/test-class-constructor18-expected.txt deleted file mode 100644 index fd9e095cb07f071f2b6181d80400ed9d4a518b25..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor18-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: super() must be called before this/super access. [test-class-constructor18.ts:22:5] diff --git a/es2panda/test/parser/ts/test-class-constructor18.ts b/es2panda/test/parser/ts/test-class-constructor18.ts deleted file mode 100644 index f197625516363a80f7778c9a92bce4426780fd32..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor18.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class B { - a: number = 1; -} - -class C extends B { - constructor() { - let a = { super: super.a } - super(); - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor19-expected.txt b/es2panda/test/parser/ts/test-class-constructor19-expected.txt deleted file mode 100644 index c69481bfd247ce36848028a648787e82155041bf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor19-expected.txt +++ /dev/null @@ -1,820 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "field", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 123, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "method", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "sField", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "hello world", - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "sMethod", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "kind": "method", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "acc", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "kind": "get", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "", - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "acc", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "kind": "set", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 15 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "sAcc", - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 21 - } - } - }, - "kind": "get", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 24 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "sAcc", - "loc": { - "start": { - "line": 25, - "column": 16 - }, - "end": { - "line": 25, - "column": 21 - } - } - }, - "kind": "set", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 22 - }, - "end": { - "line": 25, - "column": 23 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 33 - }, - "end": { - "line": 25, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 35 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 35 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 26, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 27, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor19.ts b/es2panda/test/parser/ts/test-class-constructor19.ts deleted file mode 100644 index 10b9cff137f73602b05a137cc1f801f99b0f1316..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor19.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -class A { - constructor() {} - #field = 123; - #method() {} - static #sField = "hello world"; - static #sMethod() {} - get #acc() { return ""; } - set #acc(x: string) {} - static get #sAcc() { return 0; } - static set #sAcc(x: number) {} -} diff --git a/es2panda/test/parser/ts/test-class-constructor2-expected.txt b/es2panda/test/parser/ts/test-class-constructor2-expected.txt deleted file mode 100644 index e2a756d71f57b38c2657a10b3ee9afec4e58cfae..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructor implementation is missing. [test-class-constructor2.ts:21:5] diff --git a/es2panda/test/parser/ts/test-class-constructor2.ts b/es2panda/test/parser/ts/test-class-constructor2.ts deleted file mode 100644 index 420f9d432613e148d405bc1488bbbea02ce36f10..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(); - constructor() { }; - b: string; - constructor(); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-constructor3-expected.txt b/es2panda/test/parser/ts/test-class-constructor3-expected.txt deleted file mode 100644 index f7b8adab63335418b382f6ea47dfa7b651f02414..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '(' expected [test-class-constructor3.ts:18:16] diff --git a/es2panda/test/parser/ts/test-class-constructor3.ts b/es2panda/test/parser/ts/test-class-constructor3.ts deleted file mode 100644 index fe4ce5e15a837bc3fb7d10d06903cb9ccc09d96d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor?() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-constructor4-expected.txt b/es2panda/test/parser/ts/test-class-constructor4-expected.txt deleted file mode 100644 index e1214afcca175e91ceed969c960be014a2dd6c00..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructor implementation is missing. [test-class-constructor4.ts:18:5] diff --git a/es2panda/test/parser/ts/test-class-constructor4.ts b/es2panda/test/parser/ts/test-class-constructor4.ts deleted file mode 100644 index 884f24519ebf592938db8c2d00dfef084237273a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-constructor5-expected.txt b/es2panda/test/parser/ts/test-class-constructor5-expected.txt deleted file mode 100644 index 664dd9f46b5320a6a066d9cfc050b0e3daa28c4e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Multiple constructor implementations are not allowed. [test-class-constructor5.ts:19:5] diff --git a/es2panda/test/parser/ts/test-class-constructor5.ts b/es2panda/test/parser/ts/test-class-constructor5.ts deleted file mode 100644 index 4650afdf632b7a28fe89aa95d9fdb4f2669c99c0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor5.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor() { }; - constructor() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-constructor6-expected.txt b/es2panda/test/parser/ts/test-class-constructor6-expected.txt deleted file mode 100644 index 0a3ef172bbb16d16add5e595deedbe9102c27b53..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructor implementation is missing. [test-class-constructor6.ts:19:5] diff --git a/es2panda/test/parser/ts/test-class-constructor6.ts b/es2panda/test/parser/ts/test-class-constructor6.ts deleted file mode 100644 index e5b1b8699faddb9a7f1c6d7919379c921db96e07..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor6.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base {} -class A extends Base { - constructor(); -} diff --git a/es2panda/test/parser/ts/test-class-constructor7-expected.txt b/es2panda/test/parser/ts/test-class-constructor7-expected.txt deleted file mode 100644 index eefe44b72206c41181429f4e80d645e58a580290..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor7-expected.txt +++ /dev/null @@ -1,258 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 30 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-constructor7.ts b/es2panda/test/parser/ts/test-class-constructor7.ts deleted file mode 100644 index 54836b51d672511c11af6c86d496d07b74c3340f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor7.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base {} -declare class A extends Base { - constructor(); -} diff --git a/es2panda/test/parser/ts/test-class-constructor8-expected.txt b/es2panda/test/parser/ts/test-class-constructor8-expected.txt deleted file mode 100644 index a12e5c163837b8817e791b1fa1c950289c65f551..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructors for derived classes must contain a super call. [test-class-constructor8.ts:19:5] diff --git a/es2panda/test/parser/ts/test-class-constructor8.ts b/es2panda/test/parser/ts/test-class-constructor8.ts deleted file mode 100644 index 78ef0a584e9c2182e6a0b55e6d663b4ef1ddfef9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor8.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base {} -class A extends Base { - constructor() {} -} diff --git a/es2panda/test/parser/ts/test-class-constructor9-expected.txt b/es2panda/test/parser/ts/test-class-constructor9-expected.txt deleted file mode 100644 index 03595b2cdcaafcddbf2d034908d457a2ba6166ae..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Constructors for derived classes must contain a super call. [test-class-constructor9.ts:19:5] diff --git a/es2panda/test/parser/ts/test-class-constructor9.ts b/es2panda/test/parser/ts/test-class-constructor9.ts deleted file mode 100644 index debed6631d0c0bf6a8864c0e718aa4c9e6e693aa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-constructor9.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base {} -class A extends Base { - constructor() { - print("hello"); - } -} diff --git a/es2panda/test/parser/ts/test-class-definition-expected.txt b/es2panda/test/parser/ts/test-class-definition-expected.txt deleted file mode 100644 index 91aff142a309197f02b889b5b422dcc668fbd27c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition-expected.txt +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "kind": "get", - "accessibility": "private", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 18, - "column": 30 - }, - "end": { - "line": 18, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "g", - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": true, - "async": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": true, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 21, - "column": 30 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": true, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "NumberLiteral", - "value": 67, - "loc": { - "start": { - "line": 22, - "column": 29 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "j", - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 30 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 30 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "private", - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 18 - } - } - }, - "kind": "method", - "accessibility": "protected", - "static": false, - "optional": false, - "computed": true, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": true, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 22 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 20 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 26, - "column": 23 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "o", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 7 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "l", - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "kind": "set", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 12 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "l", - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 17 - } - } - }, - "kind": "get", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 29, - "column": 29 - }, - "end": { - "line": 29, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 30, - "column": 16 - }, - "end": { - "line": 30, - "column": 17 - } - } - }, - "kind": "get", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 30, - "column": 29 - }, - "end": { - "line": 30, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 22 - }, - "end": { - "line": 30, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 30, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 32 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 32 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 20 - } - } - }, - "kind": "set", - "accessibility": "protected", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 21 - }, - "end": { - "line": 31, - "column": 22 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 31, - "column": 32 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 35 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Bar", - "loc": { - "start": { - "line": 34, - "column": 7 - }, - "end": { - "line": 34, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 34, - "column": 66 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 14 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 14 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 34, - "column": 17 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 34, - "column": 20 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 34, - "column": 24 - }, - "end": { - "line": 34, - "column": 25 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 24 - }, - "end": { - "line": 34, - "column": 25 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "let", - "loc": { - "start": { - "line": 34, - "column": 27 - }, - "end": { - "line": 34, - "column": 30 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 27 - }, - "end": { - "line": 34, - "column": 30 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "var", - "loc": { - "start": { - "line": 34, - "column": 32 - }, - "end": { - "line": 34, - "column": 35 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 32 - }, - "end": { - "line": 34, - "column": 35 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 34, - "column": 37 - }, - "end": { - "line": 34, - "column": 42 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 37 - }, - "end": { - "line": 34, - "column": 42 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "function", - "loc": { - "start": { - "line": 34, - "column": 44 - }, - "end": { - "line": 34, - "column": 52 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 44 - }, - "end": { - "line": 34, - "column": 52 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 34, - "column": 54 - }, - "end": { - "line": 34, - "column": 55 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 58 - }, - "end": { - "line": 34, - "column": 64 - } - } - }, - "definite": true, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 54 - }, - "end": { - "line": 34, - "column": 55 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 66 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 34, - "column": 66 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Baz", - "loc": { - "start": { - "line": 36, - "column": 7 - }, - "end": { - "line": 36, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "name", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 38, - "column": 23 - }, - "end": { - "line": 38, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 38, - "column": 21 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 13 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "name", - "loc": { - "start": { - "line": 39, - "column": 14 - }, - "end": { - "line": 39, - "column": 19 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 19 - } - } - }, - "right": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 39, - "column": 22 - }, - "end": { - "line": 39, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 31 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "name", - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 10 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 37, - "column": 18 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 41, - "column": 20 - }, - "end": { - "line": 41, - "column": 24 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "name", - "loc": { - "start": { - "line": 41, - "column": 25 - }, - "end": { - "line": 41, - "column": 30 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 41, - "column": 20 - }, - "end": { - "line": 41, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 13 - }, - "end": { - "line": 41, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 11 - }, - "end": { - "line": 41, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 8 - }, - "end": { - "line": 41, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 8 - }, - "end": { - "line": 41, - "column": 32 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 32 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 36, - "column": 11 - }, - "end": { - "line": 42, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 42, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Inga", - "loc": { - "start": { - "line": 44, - "column": 16 - }, - "end": { - "line": 44, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 10 - }, - "end": { - "line": 47, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 45, - "column": 14 - }, - "end": { - "line": 45, - "column": 15 - } - } - }, - "kind": "method", - "abstract": true, - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 45, - "column": 15 - }, - "end": { - "line": 45, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 15 - }, - "end": { - "line": 45, - "column": 18 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 18 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "aa", - "loc": { - "start": { - "line": 46, - "column": 5 - }, - "end": { - "line": 46, - "column": 7 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 46, - "column": 10 - }, - "end": { - "line": 46, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 7 - }, - "end": { - "line": 46, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 7 - }, - "end": { - "line": 46, - "column": 13 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 5 - }, - "end": { - "line": 46, - "column": 13 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 44, - "column": 21 - }, - "end": { - "line": 47, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 10 - }, - "end": { - "line": 47, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 48, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definition.ts b/es2panda/test/parser/ts/test-class-definition.ts deleted file mode 100644 index 19f474c93565ccc3096a63d34d0f27c0fc1cc504..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - private static get a() { return } - public async *g() { } - static declare readonly [5] - static declare readonly ["b"] - static readonly declare 67 - declare static readonly j - private; - protected *[1]() { } - public static k = "bar" - #o = 4; - set l(b: number) { }; - public get l() { return 2 }; - public get m() { return 2 }; - protected set m(b: number) { }; -} - -class Bar { c; d() { } e; let; var; const; function; f!: number } - -class Baz { - #name: string; - constructor(name: string) { - this.#name = name; - } - bar() { return this.#name }; -} - -abstract class Inga { - abstract a(); - aa() { }; -} diff --git a/es2panda/test/parser/ts/test-class-definition27-expected.txt b/es2panda/test/parser/ts/test-class-definition27-expected.txt deleted file mode 100644 index 6a1fea6c428a36f509e6d7977cc6d3b31f112d41..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition27-expected.txt +++ /dev/null @@ -1,697 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "name", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 21 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "right": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 20, - "column": 20 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "getName", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, - "property": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "xxx", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 12 - }, - "end": { - "line": 27, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 19 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "obj", - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 20 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "xxx", - "loc": { - "start": { - "line": 28, - "column": 21 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 21 - }, - "end": { - "line": 28, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "Class_async", - "loc": { - "start": { - "line": 28, - "column": 26 - }, - "end": { - "line": 28, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 40 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 29, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definition27.ts b/es2panda/test/parser/ts/test-class-definition27.ts deleted file mode 100644 index 0369612ab8419f54e62ffe177342579c287c1a63..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition27.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class async { - name: T; - constructor(name: T) { - this.name = name; - } - getName(): T { - return this.name; - } -} - -type xxx = string; -var obj = new async("Class_async"); diff --git a/es2panda/test/parser/ts/test-class-definition28-expected.txt b/es2panda/test/parser/ts/test-class-definition28-expected.txt deleted file mode 100644 index 6500ccac63589a70d7e2c69e64a2dcf2bb589fe1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition28-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An accessibility modifier cannot be used with a private identifier. [test-class-definition28.ts:18:12] diff --git a/es2panda/test/parser/ts/test-class-definition28.ts b/es2panda/test/parser/ts/test-class-definition28.ts deleted file mode 100644 index 57f5efd4846550dce174a04f51dc8b403cd4f9fa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition28.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - public #foo = 3; - private #bar = 3; - protected #baz = 3; - - public #fooMethod() { return 3; } - private #barMethod() { return 3; } - protected #bazMethod() { return 3; } - - public get #fooProp() { return 3; } - public set #fooProp(value: number) { } - private get #barProp() { return 3; } - private set #barProp(value: number) { } - protected get #bazProp() { return 3; } - protected set #bazProp(value: number) { } -} diff --git a/es2panda/test/parser/ts/test-class-definition29-expected.txt b/es2panda/test/parser/ts/test-class-definition29-expected.txt deleted file mode 100644 index 3bcb7f2eb38933866faea100d16b2d14821a09c4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition29-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'declare' modifier cannot be used with a private identifier. [test-class-definition29.ts:18:13] diff --git a/es2panda/test/parser/ts/test-class-definition29.ts b/es2panda/test/parser/ts/test-class-definition29.ts deleted file mode 100644 index 6db01fd31da4556b2c7e76b72e03722ced618d85..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition29.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - declare #what: number; - declare #whatMethod(); - declare get #whatProp(); - declare set #whatProp(value: number); -} diff --git a/es2panda/test/parser/ts/test-class-definition30-expected.txt b/es2panda/test/parser/ts/test-class-definition30-expected.txt deleted file mode 100644 index 23261b117013093919c6af3d757091f279e76153..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition30-expected.txt +++ /dev/null @@ -1,185 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "abstract": true, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 24 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definition30.ts b/es2panda/test/parser/ts/test-class-definition30.ts deleted file mode 100644 index a41f0aa83b3d24b2277bddd8fbe1f8930f716fa3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definition30.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract class C { - abstract accessor p: any; -} diff --git a/es2panda/test/parser/ts/test-class-definiton1-expected.txt b/es2panda/test/parser/ts/test-class-definiton1-expected.txt deleted file mode 100644 index 6b7c48ef816b2b676331e2d8d02a623b8558d3f4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Static modifier can not appear on a constructor [test-class-definiton1.ts:18:12] diff --git a/es2panda/test/parser/ts/test-class-definiton1.ts b/es2panda/test/parser/ts/test-class-definiton1.ts deleted file mode 100644 index f47f6308ce4c43ae2c3b56456d6e1eb518b83720..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - static constructor() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton10-expected.txt b/es2panda/test/parser/ts/test-class-definiton10-expected.txt deleted file mode 100644 index 7a36430e0238c98e3e3a0da961df7874564cf13d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton10.ts:18:63] diff --git a/es2panda/test/parser/ts/test-class-definiton10.ts b/es2panda/test/parser/ts/test-class-definiton10.ts deleted file mode 100644 index acd60b022150028af49e59c64c5c844925973d35..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton10.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - a() { } b() { } c() { } private static readonly declare d e; -} diff --git a/es2panda/test/parser/ts/test-class-definiton11-expected.txt b/es2panda/test/parser/ts/test-class-definiton11-expected.txt deleted file mode 100644 index e78e6c73fb2db78d57b5711b187700749c574ade..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton11-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton11.ts:18:11] diff --git a/es2panda/test/parser/ts/test-class-definiton11.ts b/es2panda/test/parser/ts/test-class-definiton11.ts deleted file mode 100644 index 191ea09d860dbff45487904f91518c607e1cc400..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton11.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - const a = 3; -} diff --git a/es2panda/test/parser/ts/test-class-definiton12-expected.txt b/es2panda/test/parser/ts/test-class-definiton12-expected.txt deleted file mode 100644 index a2f20fffec50b54947b78a569b9751848f9704e2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton12-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton12.ts:18:9] diff --git a/es2panda/test/parser/ts/test-class-definiton12.ts b/es2panda/test/parser/ts/test-class-definiton12.ts deleted file mode 100644 index 257c51111f65d97f487d908151b5d12d2cfabe82..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton12.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - var a = 3; -} diff --git a/es2panda/test/parser/ts/test-class-definiton13-expected.txt b/es2panda/test/parser/ts/test-class-definiton13-expected.txt deleted file mode 100644 index 23566b5f09beed4247a773cbea9bab621fd75a92..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton13-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton13.ts:18:9] diff --git a/es2panda/test/parser/ts/test-class-definiton13.ts b/es2panda/test/parser/ts/test-class-definiton13.ts deleted file mode 100644 index b705c668f72e869e25b06ab2cb6460c2ab5a1c33..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton13.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - let a = 3; -} diff --git a/es2panda/test/parser/ts/test-class-definiton14-expected.txt b/es2panda/test/parser/ts/test-class-definiton14-expected.txt deleted file mode 100644 index ca26645bdfc6aa1b7312dc8db9e31c49e00c183d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton14-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton14.ts:18:14] diff --git a/es2panda/test/parser/ts/test-class-definiton14.ts b/es2panda/test/parser/ts/test-class-definiton14.ts deleted file mode 100644 index ea1eea4f1d6c84c412b38de99600c0655a83eb52..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton14.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - function a(); -} diff --git a/es2panda/test/parser/ts/test-class-definiton15-expected.txt b/es2panda/test/parser/ts/test-class-definiton15-expected.txt deleted file mode 100644 index 517f45dd6b45ee69cdce7beb735ecaacbd923502..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton15-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A get accessor must be at least as accessible as the setter [test-class-definiton15.ts:18:9] diff --git a/es2panda/test/parser/ts/test-class-definiton15.ts b/es2panda/test/parser/ts/test-class-definiton15.ts deleted file mode 100644 index 2e0ac2657bedc730ce57df5d663be06cb5ffdd6e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton15.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - set 5(k) { } - private get 5() { return } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton16-expected.txt b/es2panda/test/parser/ts/test-class-definiton16-expected.txt deleted file mode 100644 index 66c641cdedd58e34371beef4d7973edde23a9762..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton16-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A get accessor must be at least as accessible as the setter [test-class-definiton16.ts:18:17] diff --git a/es2panda/test/parser/ts/test-class-definiton16.ts b/es2panda/test/parser/ts/test-class-definiton16.ts deleted file mode 100644 index 6395c69a33a17dac3f5e8376ce2fd7ad8c570fb9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton16.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - private get 5() { return } - protected set 5(k) { } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton17-expected.txt b/es2panda/test/parser/ts/test-class-definiton17-expected.txt deleted file mode 100644 index df07463839a17bf82c966f68f28861a792009a02..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton17-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Abstract methods can only appear within an abstract class. [test-class-definiton17.ts:18:14] diff --git a/es2panda/test/parser/ts/test-class-definiton17.ts b/es2panda/test/parser/ts/test-class-definiton17.ts deleted file mode 100644 index 7a8cf7096ce7998bcb3941332d33d53cfc266e9f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton17.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - abstract a() -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton18-expected.txt b/es2panda/test/parser/ts/test-class-definiton18-expected.txt deleted file mode 100644 index 05ccf9db3bdfd94b2f4ca349545023d61c6b7e9e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton18-expected.txt +++ /dev/null @@ -1,267 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "kind": "method", - "abstract": true, - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton18.ts b/es2panda/test/parser/ts/test-class-definiton18.ts deleted file mode 100644 index 700141124ffe25e37cac6a1e73c96e6983065f91..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton18.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract class Foo { - a(); - abstract a(); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton19-expected.txt b/es2panda/test/parser/ts/test-class-definiton19-expected.txt deleted file mode 100644 index 2f5e4b67921740f9c26b095801ee98620c963fd0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton19-expected.txt +++ /dev/null @@ -1,575 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "method", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "thisParam": { - "type": "Identifier", - "name": "this", - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 31 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "method1", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "thisParam": { - "type": "Identifier", - "name": "this", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "method2", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 20 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 32 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 34 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton19.ts b/es2panda/test/parser/ts/test-class-definiton19.ts deleted file mode 100644 index cc97a38e5230340d61e2c87e2cfa9125bf9056d6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton19.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C { - method(this: this, ...args: number[]) {} - method1(this, ...args: number[]) {} - method2(...args: number[]) {} -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton2-expected.txt b/es2panda/test/parser/ts/test-class-definiton2-expected.txt deleted file mode 100644 index a533431cfa496c07614158bba0bf0795add1b6be..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Class method can not be declare nor readonly [test-class-definiton2.ts:18:25] diff --git a/es2panda/test/parser/ts/test-class-definiton2.ts b/es2panda/test/parser/ts/test-class-definiton2.ts deleted file mode 100644 index e9068eebbf9eac88e204c5fb0fc70b9ab8b8e74c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - private readonly [a](){} -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton20-expected.txt b/es2panda/test/parser/ts/test-class-definiton20-expected.txt deleted file mode 100644 index 87c5256e98c42bf6eaa97f68656e6fe00d45f240..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton20-expected.txt +++ /dev/null @@ -1,658 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "value": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "TSThisType", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": false, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "value": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 21 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "TSThisType", - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": false, - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 42 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "value": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 26, - "column": 17 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 17 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 25 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "TSThisType", - "loc": { - "start": { - "line": 26, - "column": 29 - }, - "end": { - "line": 26, - "column": 33 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 26, - "column": 37 - }, - "end": { - "line": 26, - "column": 43 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 26, - "column": 29 - }, - "end": { - "line": 26, - "column": 43 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": false, - "loc": { - "start": { - "line": 27, - "column": 16 - }, - "end": { - "line": 27, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 47 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 28, - "column": 6 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 29, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 30, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton20.ts b/es2panda/test/parser/ts/test-class-definiton20.ts deleted file mode 100644 index cc1c9ec68349fbaf798e66edc58922898b22cf73..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton20.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C { - a = () : this is number => { - return false; - } - - b = (b : number) : this is number => { - return false; - } - - c = (...c : number[]) : this is number => { - return false; - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton21-expected.txt b/es2panda/test/parser/ts/test-class-definiton21-expected.txt deleted file mode 100644 index 1d1c7c31f75eee57e6f258ff4a2179660fcac94d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton21-expected.txt +++ /dev/null @@ -1,316 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "ClassExpression", - "definition": { - "id": null, - "superClass": null, - "implements": [ - { - "type": "TSClassImplements", - "expression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 28 - } - } - } - ], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 29 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton21.ts b/es2panda/test/parser/ts/test-class-definiton21.ts deleted file mode 100644 index f4c2ca700780b1ddc73482d3464bbf03987cf578..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton21.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A{} -var a = class implements A{} diff --git a/es2panda/test/parser/ts/test-class-definiton22-expected.txt b/es2panda/test/parser/ts/test-class-definiton22-expected.txt deleted file mode 100644 index 7bb707bc7be07e60c7c1f7f6506d666d9d87d216..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton22-expected.txt +++ /dev/null @@ -1,640 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "superClass": null, - "implements": [ - { - "type": "TSClassImplements", - "expression": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 26 - } - } - } - ], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 5 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "superTypeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 21, - "column": 22 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 22 - }, - "end": { - "line": 21, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton22.ts b/es2panda/test/parser/ts/test-class-definiton22.ts deleted file mode 100644 index e7d3305995c70b8dc3629fe208442d5dedb85812..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton22.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I{} -class C implements I { - [a:number]:T; -} -class D extends C { -} diff --git a/es2panda/test/parser/ts/test-class-definiton23-expected.txt b/es2panda/test/parser/ts/test-class-definiton23-expected.txt deleted file mode 100644 index 97233ab8cafd7c1fce8bf1e5fd6c866d962bd369..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton23-expected.txt +++ /dev/null @@ -1,1067 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 22, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 22, - "column": 8 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 26, - "column": 21 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 21 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 27, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 27, - "column": 13 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 27, - "column": 25 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 30, - "column": 22 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 30, - "column": 29 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 29 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 31, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 31, - "column": 12 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 31, - "column": 29 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 29 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 32, - "column": 19 - }, - "end": { - "line": 32, - "column": 21 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 32, - "column": 22 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 32, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 34, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 34, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton23.ts b/es2panda/test/parser/ts/test-class-definiton23.ts deleted file mode 100644 index ad97bf3934d0d66b8dafc1534d8e8d9fed7aaace..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton23.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function C1() : C1 -function C1() : any {} -declare class C1 {} - -declare function C2() : C2 -declare function C2() : C2 -declare class C2 {} - -namespace ns { - function C1() : C1 - function C1() : any {} - declare class C1 {} - - declare function C2() : C2 - declare function C2() : C2 - declare class C2 {} -} diff --git a/es2panda/test/parser/ts/test-class-definiton24-expected.txt b/es2panda/test/parser/ts/test-class-definiton24-expected.txt deleted file mode 100644 index 3685333522f72471100441a3d15093378534f352..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton24-expected.txt +++ /dev/null @@ -1,561 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 26, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 26, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton24.ts b/es2panda/test/parser/ts/test-class-definiton24.ts deleted file mode 100644 index 35d3884acab8515e35bda1a54f58887997d266db..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton24.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare namespace ns { - class C1 {} - function C1() : C1 - function C1() : C1 - - function C2() : C2 - function C2() : C2 - class C2 {} -} diff --git a/es2panda/test/parser/ts/test-class-definiton25-expected.txt b/es2panda/test/parser/ts/test-class-definiton25-expected.txt deleted file mode 100644 index 4407dce5a4a4e369ee97c4b2ff709af315f321e1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton25-expected.txt +++ /dev/null @@ -1,1067 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 21 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 28, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 28, - "column": 13 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C1", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 28, - "column": 21 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 28, - "column": 25 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 30, - "column": 22 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 31, - "column": 29 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 29 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 32, - "column": 22 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C2", - "loc": { - "start": { - "line": 32, - "column": 29 - }, - "end": { - "line": 32, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 29 - }, - "end": { - "line": 32, - "column": 31 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 33, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 34, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 34, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton25.ts b/es2panda/test/parser/ts/test-class-definiton25.ts deleted file mode 100644 index b97ed7f7df9102235b15265f5fe3f225e1d0762d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton25.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class C1 {} -function C1() : C1 -function C1() : any {} - -declare class C2 {} -declare function C2() : C2 -declare function C2() : C2 - -namespace ns { - declare class C1 {} - function C1() : C1 - function C1() : any {} - - declare class C2 {} - declare function C2() : C2 - declare function C2() : C2 -} diff --git a/es2panda/test/parser/ts/test-class-definiton26-expected.txt b/es2panda/test/parser/ts/test-class-definiton26-expected.txt deleted file mode 100644 index 1495abf4843780c6b4e8f571ba840a50676cb306..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton26-expected.txt +++ /dev/null @@ -1,260 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton26.ts b/es2panda/test/parser/ts/test-class-definiton26.ts deleted file mode 100644 index 8411930945fcaf4339fb4f3501b2c15ae370832c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton26.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C{ - get() {} -} diff --git a/es2panda/test/parser/ts/test-class-definiton27-expected.txt b/es2panda/test/parser/ts/test-class-definiton27-expected.txt deleted file mode 100644 index 4eaed038df130910513963e224574f1f904a534e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton27-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Property cannot have an initializer because it is marked abstract. [test-class-definiton27.ts:18:27] diff --git a/es2panda/test/parser/ts/test-class-definiton27.ts b/es2panda/test/parser/ts/test-class-definiton27.ts deleted file mode 100644 index ed2dcdad64a20b05fc9433b4929fe887921b32fc..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton27.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract class A { - abstract prop: string = "str"; -} diff --git a/es2panda/test/parser/ts/test-class-definiton3-expected.txt b/es2panda/test/parser/ts/test-class-definiton3-expected.txt deleted file mode 100644 index a67927c10ab55cd80be634a25c1929348a17d7e3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-class-definiton3.ts:18:12] diff --git a/es2panda/test/parser/ts/test-class-definiton3.ts b/es2panda/test/parser/ts/test-class-definiton3.ts deleted file mode 100644 index 5f129be02fa8c17ac4f55a519f73afee2c62e230..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - static static a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton4-expected.txt b/es2panda/test/parser/ts/test-class-definiton4-expected.txt deleted file mode 100644 index 7b9e59d5fad005acc4fd4606732ed7c2bc5b437d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Expected '(' [test-class-definiton4.ts:18:7] diff --git a/es2panda/test/parser/ts/test-class-definiton4.ts b/es2panda/test/parser/ts/test-class-definiton4.ts deleted file mode 100644 index f73cdc808f2541c88b8d1f5c66a821717cdaeb8b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - *b; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton5-expected.txt b/es2panda/test/parser/ts/test-class-definiton5-expected.txt deleted file mode 100644 index 8c98e1d6ee544076940ae2b5ed9f162cf08358e6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-class-definiton5.ts:18:14] diff --git a/es2panda/test/parser/ts/test-class-definiton5.ts b/es2panda/test/parser/ts/test-class-definiton5.ts deleted file mode 100644 index 12b2b010d04e03038229f035caf544067f695a5b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton5.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - readonly static a = "foo"; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton6-expected.txt b/es2panda/test/parser/ts/test-class-definiton6-expected.txt deleted file mode 100644 index 034d9f2c0053f24d7029fe4e6676f436ec2ed611..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A get accessor must be at least as accessible as the setter [test-class-definiton6.ts:18:17] diff --git a/es2panda/test/parser/ts/test-class-definiton6.ts b/es2panda/test/parser/ts/test-class-definiton6.ts deleted file mode 100644 index 13e493e87f96f37842f13aa598e8bc1199df3338..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton6.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - private get 5() { return } - set 5(k) { } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton7-expected.txt b/es2panda/test/parser/ts/test-class-definiton7-expected.txt deleted file mode 100644 index a6dbdf416af1fd0f7da29e3b9a4c9119d0a3bc74..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton7-expected.txt +++ /dev/null @@ -1,172 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-definiton7.ts b/es2panda/test/parser/ts/test-class-definiton7.ts deleted file mode 100644 index 741dd3bac8512f9eeca87e74c6c618ab92729787..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - static #a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton8-expected.txt b/es2panda/test/parser/ts/test-class-definiton8-expected.txt deleted file mode 100644 index c28a931252d070755c817ee4adf67129f3dd2d7d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton8.ts:18:9] diff --git a/es2panda/test/parser/ts/test-class-definiton8.ts b/es2panda/test/parser/ts/test-class-definiton8.ts deleted file mode 100644 index c60e2b4616d3d39e76da6af263ebc92cbe09a8ab..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton8.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Foo { - a() b() -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-definiton9-expected.txt b/es2panda/test/parser/ts/test-class-definiton9-expected.txt deleted file mode 100644 index eba0ef841cd1d9abf2224e0f0373a94c005848ae..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-class-definiton9.ts:18:7] diff --git a/es2panda/test/parser/ts/test-class-definiton9.ts b/es2panda/test/parser/ts/test-class-definiton9.ts deleted file mode 100644 index 00779a0a3c63e7c62813bf2a6dd992451a0f5caa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-definiton9.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - a b; -} diff --git a/es2panda/test/parser/ts/test-class-method-optional-expected.txt b/es2panda/test/parser/ts/test-class-method-optional-expected.txt deleted file mode 100644 index 0a319a0729f10e6f20cf1a95764ad27911b01dff..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-optional-expected.txt +++ /dev/null @@ -1,321 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": true, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": true, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 20 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-optional.ts b/es2panda/test/parser/ts/test-class-method-optional.ts deleted file mode 100644 index f722db603c2914ca35c4760a418ae01a2c8bd65f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-optional.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - a: number = 0; - b?: number; - get?(): number; -} diff --git a/es2panda/test/parser/ts/test-class-method-overload-expected.txt b/es2panda/test/parser/ts/test-class-method-overload-expected.txt deleted file mode 100644 index 2d2cdb6f043c61ccfd989b7e3302828a834d804c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload-expected.txt +++ /dev/null @@ -1,1768 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Class1", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 9 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Class2", - "loc": { - "start": { - "line": 24, - "column": 7 - }, - "end": { - "line": 24, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 44, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 25, - "column": 8 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 26, - "column": 8 - }, - "end": { - "line": 26, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 19 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 29, - "column": 8 - }, - "end": { - "line": 29, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 8 - }, - "end": { - "line": 29, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 31, - "column": 11 - }, - "end": { - "line": 31, - "column": 17 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - { - "type": "Identifier", - "name": "n", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 23 - }, - "end": { - "line": 31, - "column": 29 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 20 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 32, - "column": 14 - }, - "end": { - "line": 32, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 15 - } - } - }, - "right": { - "type": "LogicalExpression", - "operator": "||", - "left": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 19 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "", - "loc": { - "start": { - "line": 32, - "column": 23 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 15 - } - } - }, - "right": { - "type": "LogicalExpression", - "operator": "||", - "left": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 19 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 33, - "column": 23 - }, - "end": { - "line": 33, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 25 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 34, - "column": 14 - }, - "end": { - "line": 34, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 15 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 31 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "1", - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 37, - "column": 6 - }, - "end": { - "line": 37, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 6 - }, - "end": { - "line": 37, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 38, - "column": 6 - }, - "end": { - "line": 38, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 6 - }, - "end": { - "line": 38, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "1", - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 39, - "column": 8 - }, - "end": { - "line": 39, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 8 - }, - "end": { - "line": 39, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 40, - "column": 9 - }, - "end": { - "line": 40, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 6 - }, - "end": { - "line": 40, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 6 - }, - "end": { - "line": 40, - "column": 12 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 12 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 41, - "column": 10 - }, - "end": { - "line": 41, - "column": 14 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 13 - } - } - }, - "property": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 42, - "column": 14 - }, - "end": { - "line": 42, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 15 - }, - "end": { - "line": 43, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 6 - }, - "end": { - "line": 43, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 6 - }, - "end": { - "line": 43, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 43, - "column": 6 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 44, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 44, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 45, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload.ts b/es2panda/test/parser/ts/test-class-method-overload.ts deleted file mode 100644 index 69f9ad7450fc55174926d4fdd38bad60f204fed2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Class1 { - constructor(a: number); - a(); - a(); - b(); -} - -class Class2 { - s: string; - n: number; - a(); - "a"(s?: string); - "a"(); - a(); - a(s?: string, n?: number) { - this.s = s || ""; - this.n = n || 0; - this.f(); - }; - "1"(); - 1(); - 1(); - "1"(); - 1() { }; - f(): void { - this.n++; - }; -} diff --git a/es2panda/test/parser/ts/test-class-method-overload1-expected.txt b/es2panda/test/parser/ts/test-class-method-overload1-expected.txt deleted file mode 100644 index 67325dd9622a1309bb4456c7f292cdbe2022bea4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload1-expected.txt +++ /dev/null @@ -1,326 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload1.ts b/es2panda/test/parser/ts/test-class-method-overload1.ts deleted file mode 100644 index 248f22cb698230754360843edea14a2ef544c1f6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload1.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar(); - baz: string; - bar() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload10-expected.txt b/es2panda/test/parser/ts/test-class-method-overload10-expected.txt deleted file mode 100644 index c9b1dfa12ed29524914a6e5722fbef7595643627..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload10-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload10.ts b/es2panda/test/parser/ts/test-class-method-overload10.ts deleted file mode 100644 index 5070ab1cdef8644adb1ee77ab5596f3e9586d291..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload10.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - "bar"(); - baz() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload11-expected.txt b/es2panda/test/parser/ts/test-class-method-overload11-expected.txt deleted file mode 100644 index 852fdcd835c48d40c3a887dcca93a6a61777cfd0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload11-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload11.ts b/es2panda/test/parser/ts/test-class-method-overload11.ts deleted file mode 100644 index 804ebf9b56c646eba4da994e4b183d00ed29f617..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload11.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - "bar"(); - 1() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload12-expected.txt b/es2panda/test/parser/ts/test-class-method-overload12-expected.txt deleted file mode 100644 index 8a633d9ee6d911cc52ed0f745b64e0bfcbc09dfa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload12-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "2", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload12.ts b/es2panda/test/parser/ts/test-class-method-overload12.ts deleted file mode 100644 index 649138163ab46dc0aaa1b7b131d31735a6cd05a2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload12.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - 1(); - "2"() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload13-expected.txt b/es2panda/test/parser/ts/test-class-method-overload13-expected.txt deleted file mode 100644 index 8ffee6231bc90cf5f03b8c28c53dae2d9cf05c43..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload13-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload13.ts b/es2panda/test/parser/ts/test-class-method-overload13.ts deleted file mode 100644 index 123a7754256977d4b3fe341e77cc00332f6c9ea8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload13.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - 1(); - 2() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload2-expected.txt b/es2panda/test/parser/ts/test-class-method-overload2-expected.txt deleted file mode 100644 index bb0b054bcd21183529a96f977eecda4d4678baa0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload2-expected.txt +++ /dev/null @@ -1,390 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 11 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload2.ts b/es2panda/test/parser/ts/test-class-method-overload2.ts deleted file mode 100644 index b3489d4e12ae317147b3d0bc395170f1e1cf3be7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar(); - bar() { }; - baz: string; - bar(); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload3-expected.txt b/es2panda/test/parser/ts/test-class-method-overload3-expected.txt deleted file mode 100644 index 61140f664a6fa8cf49642640a1a6d93f3356f3ab..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload3-expected.txt +++ /dev/null @@ -1,344 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": true, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 15 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload3.ts b/es2panda/test/parser/ts/test-class-method-overload3.ts deleted file mode 100644 index 4d93c5d058235c4b01ce377cf8f603130289e2ec..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload3.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar(); - bar(); - bar?() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload4-expected.txt b/es2panda/test/parser/ts/test-class-method-overload4-expected.txt deleted file mode 100644 index e7b832c2bb39e66def035c9924bed14aa88c5eae..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload4-expected.txt +++ /dev/null @@ -1,202 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload4.ts b/es2panda/test/parser/ts/test-class-method-overload4.ts deleted file mode 100644 index fb59c8fbb616b70d592dc79b0c701c685bca8402..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar(); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload5-expected.txt b/es2panda/test/parser/ts/test-class-method-overload5-expected.txt deleted file mode 100644 index ea7032a42fc1d8c08aca89e6125b550dbec9b037..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload5-expected.txt +++ /dev/null @@ -1,294 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload5.ts b/es2panda/test/parser/ts/test-class-method-overload5.ts deleted file mode 100644 index 230546d16402b19019e488fa10034fd31ba9af22..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload5.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar() { }; - bar() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload6-expected.txt b/es2panda/test/parser/ts/test-class-method-overload6-expected.txt deleted file mode 100644 index 0998fa40a9af639a0d0c591b56bb2129bbaf9301..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload6-expected.txt +++ /dev/null @@ -1,372 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload6.ts b/es2panda/test/parser/ts/test-class-method-overload6.ts deleted file mode 100644 index b9caa430fdf500f14f27181ca0cc29006eb05396..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload6.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar() { }; - baz() { }; - bar() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload7-expected.txt b/es2panda/test/parser/ts/test-class-method-overload7-expected.txt deleted file mode 100644 index dd0e05870005bafddb66cb9c6f0885b12a051b0f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload7-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload7.ts b/es2panda/test/parser/ts/test-class-method-overload7.ts deleted file mode 100644 index e0d6b9f258c91dd77cbac7998a2c7e718d768f77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload7.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar(); - baz() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload8-expected.txt b/es2panda/test/parser/ts/test-class-method-overload8-expected.txt deleted file mode 100644 index b4a952011362badad2ddf4915d0ef449a53c6b90..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload8-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "baz", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload8.ts b/es2panda/test/parser/ts/test-class-method-overload8.ts deleted file mode 100644 index 173d094cdc9d039a4b9a8ea417c127262cc573a9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload8.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - bar(); - "baz"() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-method-overload9-expected.txt b/es2panda/test/parser/ts/test-class-method-overload9-expected.txt deleted file mode 100644 index 2a490f7ab712d15242e0579765f56ae8ca1e7859..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload9-expected.txt +++ /dev/null @@ -1,280 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "baz", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-method-overload9.ts b/es2panda/test/parser/ts/test-class-method-overload9.ts deleted file mode 100644 index 796886524a419aa0954392357d08ef85400fa65b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-method-overload9.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - "bar"(); - "baz"() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-modifier-keywords-1-expected.txt b/es2panda/test/parser/ts/test-class-modifier-keywords-1-expected.txt deleted file mode 100644 index c28a528bfa1282ff4766ee5c7b8d33b9c1fc2b74..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-modifier-keywords-1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'declare' modifier already seen. [test-class-modifier-keywords-1.ts:17:18] diff --git a/es2panda/test/parser/ts/test-class-modifier-keywords-1.ts b/es2panda/test/parser/ts/test-class-modifier-keywords-1.ts deleted file mode 100644 index 91aea3e718044d6a0d2049128224299126b4b04e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-modifier-keywords-1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare abstract declare class A {} diff --git a/es2panda/test/parser/ts/test-class-modifier-keywords-2-expected.txt b/es2panda/test/parser/ts/test-class-modifier-keywords-2-expected.txt deleted file mode 100644 index 544fda85c01bb0e6c772b7f4d85f7110e3c3532b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-modifier-keywords-2-expected.txt +++ /dev/null @@ -1,644 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 25 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 25 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - { - "type": "ExportDefaultDeclaration", - "declaration": { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 32 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 33 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-modifier-keywords-2.ts b/es2panda/test/parser/ts/test-class-modifier-keywords-2.ts deleted file mode 100644 index 803260fc9af6b851b7b9e2dda52e72ee9e1b9585..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-modifier-keywords-2.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract declare class A {} -export abstract class B {} -export declare class C {} -export abstract declare class D {} -export default abstract class E {} diff --git a/es2panda/test/parser/ts/test-class-modifier-keywords-3-expected.txt b/es2panda/test/parser/ts/test-class-modifier-keywords-3-expected.txt deleted file mode 100644 index b594e737b2949778a95095095e6f3fec5c19bbcb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-modifier-keywords-3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token, expected 'class'. [test-class-modifier-keywords-3.ts:17:25] diff --git a/es2panda/test/parser/ts/test-class-modifier-keywords-3.ts b/es2panda/test/parser/ts/test-class-modifier-keywords-3.ts deleted file mode 100644 index 99305311734df0077f421411e38648609f63a370..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-modifier-keywords-3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default abstract func(); diff --git a/es2panda/test/parser/ts/test-class-property-1-expected.txt b/es2panda/test/parser/ts/test-class-property-1-expected.txt deleted file mode 100644 index ae534760220a4bb2a72129e8eb0492a7c091760e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-property-1-expected.txt +++ /dev/null @@ -1,258 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": true, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 21 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-property-1.ts b/es2panda/test/parser/ts/test-class-property-1.ts deleted file mode 100644 index 8b8c1844df0c4205b87a919553c308c6191cd909..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-property-1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - set: number = 0; - get?: number = 1; -} diff --git a/es2panda/test/parser/ts/test-class-property-2-expected.txt b/es2panda/test/parser/ts/test-class-property-2-expected.txt deleted file mode 100644 index 8cda5af84262a98eb9767bf5d87512a22b8a2af5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-property-2-expected.txt +++ /dev/null @@ -1,171 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-property-2.ts b/es2panda/test/parser/ts/test-class-property-2.ts deleted file mode 100644 index bf11dd800d5a4d8f5591f43d6b73bbe59b64cc97..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-property-2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C { - get -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-class-super-1-expected.txt b/es2panda/test/parser/ts/test-class-super-1-expected.txt deleted file mode 100644 index 58c0306efe27e3cd1a7f813ef6bd04734b59f4dc..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-super-1-expected.txt +++ /dev/null @@ -1,662 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 100, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "test2", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "kind": "method", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 23 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 8 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 21 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "childTest1", - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "value": { - "type": "MemberExpression", - "object": { - "type": "Super", - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 30 - } - } - }, - "property": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 23, - "column": 31 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "childTest2", - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "value": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Super", - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "property": { - "type": "Identifier", - "name": "test2", - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 36 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 36 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 38 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 38 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 22, - "column": 22 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 26, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-class-super-1.ts b/es2panda/test/parser/ts/test-class-super-1.ts deleted file mode 100644 index cfcd134cd84a04f8dcfe5f999cc1764b234b101c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-class-super-1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Base { - static prop = 100; - static test2() { } -} - -class C extends Base { - static childTest1 = super.prop; - static childTest2 = super.test2(); -} diff --git a/es2panda/test/parser/ts/test-conditional-expression-expected.txt b/es2panda/test/parser/ts/test-conditional-expression-expected.txt deleted file mode 100644 index 667c66eb363419b6d7bc62016db19d16b31dadf0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-conditional-expression-expected.txt +++ /dev/null @@ -1,480 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "testBool", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 22 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ConditionalExpression", - "test": { - "type": "Identifier", - "name": "testBool", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "consequent": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - { - "type": "Identifier", - "name": "y", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 38 - }, - "end": { - "line": 18, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 35 - }, - "end": { - "line": 18, - "column": 36 - } - } - } - ], - "body": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 18, - "column": 50 - }, - "end": { - "line": 18, - "column": 51 - } - } - }, - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 18, - "column": 54 - }, - "end": { - "line": 18, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 50 - }, - "end": { - "line": 18, - "column": 55 - } - } - }, - "consequent": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 18, - "column": 58 - }, - "end": { - "line": 18, - "column": 59 - } - } - }, - "alternate": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 18, - "column": 62 - }, - "end": { - "line": 18, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 49 - }, - "end": { - "line": 18, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 64 - } - } - }, - "alternate": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 71 - }, - "end": { - "line": 18, - "column": 77 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 68 - }, - "end": { - "line": 18, - "column": 69 - } - } - }, - { - "type": "Identifier", - "name": "y", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 82 - }, - "end": { - "line": 18, - "column": 88 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 79 - }, - "end": { - "line": 18, - "column": 80 - } - } - } - ], - "body": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": ">", - "left": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 18, - "column": 94 - }, - "end": { - "line": 18, - "column": 95 - } - } - }, - "right": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 18, - "column": 98 - }, - "end": { - "line": 18, - "column": 99 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 94 - }, - "end": { - "line": 18, - "column": 99 - } - } - }, - "consequent": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 18, - "column": 102 - }, - "end": { - "line": 18, - "column": 103 - } - } - }, - "alternate": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 18, - "column": 106 - }, - "end": { - "line": 18, - "column": 107 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 93 - }, - "end": { - "line": 18, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 67 - }, - "end": { - "line": 18, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 67 - }, - "end": { - "line": 18, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 108 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-conditional-expression.ts b/es2panda/test/parser/ts/test-conditional-expression.ts deleted file mode 100644 index df689a56c53ff8539ef168df167df33e65846f90..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-conditional-expression.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(testBool: boolean) { - return testBool ? (x: number, y: number) => (x < y ? x : y) : (x: number, y: number) => (x > y ? x : y) -} diff --git a/es2panda/test/parser/ts/test-cyclic-module-import-expected.txt b/es2panda/test/parser/ts/test-cyclic-module-import-expected.txt deleted file mode 100644 index 5cac2014221b48ceedbaf41cdd1106125f7e9d77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-cyclic-module-import-expected.txt +++ /dev/null @@ -1,701 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "StringLiteral", - "value": "ModuleSub", - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSImportEqualsDeclaration", - "id": { - "type": "Identifier", - "name": "TargetModule", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "moduleReference": { - "type": "TSExternalModuleReference", - "expression": { - "type": "StringLiteral", - "value": "TargetModule", - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 50 - } - } - }, - "isExport": false, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 51 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ModuleSub", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "StaticVar", - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 32 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 32 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "InsVar", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "main", - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "TargetModule", - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 20 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - { - "type": "TSExportAssignment", - "declaration": { - "type": "Identifier", - "name": "ModuleSub", - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 29, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "StringLiteral", - "value": "TargetModule", - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 30 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSImportEqualsDeclaration", - "id": { - "type": "Identifier", - "name": "ModuleSub", - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - "moduleReference": { - "type": "TSExternalModuleReference", - "expression": { - "type": "StringLiteral", - "value": "ModuleSub", - "loc": { - "start": { - "line": 30, - "column": 32 - }, - "end": { - "line": 30, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 24 - }, - "end": { - "line": 30, - "column": 44 - } - } - }, - "isExport": false, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 45 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TargetModule", - "loc": { - "start": { - "line": 31, - "column": 11 - }, - "end": { - "line": 31, - "column": 23 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 20 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 33, - "column": 20 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 20 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "moduleSub", - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ModuleSub", - "loc": { - "start": { - "line": 32, - "column": 27 - }, - "end": { - "line": 32, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 27 - }, - "end": { - "line": 32, - "column": 36 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 25 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 34, - "column": 6 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 34, - "column": 6 - } - } - }, - { - "type": "TSExportAssignment", - "declaration": { - "type": "Identifier", - "name": "TargetModule", - "loc": { - "start": { - "line": 35, - "column": 14 - }, - "end": { - "line": 35, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 31 - }, - "end": { - "line": 36, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 37, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 37, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-cyclic-module-import.ts b/es2panda/test/parser/ts/test-cyclic-module-import.ts deleted file mode 100644 index 6068088306e3aed2d0dc5d20312ed84a6e1c6340..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-cyclic-module-import.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// @declaration: true -declare module "ModuleSub" { - import TargetModule = require('TargetModule'); - class ModuleSub { - public static StaticVar: number; - public InsVar: number; - public main: TargetModule; - constructor(); - } - export = ModuleSub; -} - -declare module "TargetModule" { - import ModuleSub = require('ModuleSub'); - class TargetModule { - public moduleSub: ModuleSub; - constructor(); - } - export = TargetModule; -} diff --git a/es2panda/test/parser/ts/test-declare-name-expected.txt b/es2panda/test/parser/ts/test-declare-name-expected.txt deleted file mode 100644 index 8fcba8be9307d1dd2b7a1462ffc0bb3d3a785dc1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-declare-name-expected.txt +++ /dev/null @@ -1,127 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 16 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-declare-name.ts b/es2panda/test/parser/ts/test-declare-name.ts deleted file mode 100644 index d5f305f15639fd83a7b3823d2aeefa11a737251a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-declare-name.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var declare = 1; -declare = 2; diff --git a/es2panda/test/parser/ts/test-definite-variable-expected.txt b/es2panda/test/parser/ts/test-definite-variable-expected.txt deleted file mode 100644 index 52761127fc2898f91ad61d5cfc8cef88ed7eabda..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-definite-variable-expected.txt +++ /dev/null @@ -1,73 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "definite": true, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-definite-variable.ts b/es2panda/test/parser/ts/test-definite-variable.ts deleted file mode 100644 index 409503959d24a4b5473997e0c0cbf34a4b0a632b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-definite-variable.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a!:number; diff --git a/es2panda/test/parser/ts/test-destructure-declaration-expected.txt b/es2panda/test/parser/ts/test-destructure-declaration-expected.txt deleted file mode 100644 index 48adfeeb0e2c2e5ec472635c79e4e733f335d091..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-destructure-declaration-expected.txt +++ /dev/null @@ -1,225 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 19 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "value": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "value": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } -} diff --git a/es2panda/test/parser/ts/test-destructure-declaration.ts b/es2panda/test/parser/ts/test-destructure-declaration.ts deleted file mode 100644 index f913fd152e99de5cb4cbb9f6dc736a48cce0aa4e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-destructure-declaration.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare var [a, b]; -declare var {c, d}; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-enum-declaration-expected.txt b/es2panda/test/parser/ts/test-enum-declaration-expected.txt deleted file mode 100644 index d0d013bd7e63e34b2a4e80308745b3243a6bff62..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration-expected.txt +++ /dev/null @@ -1,348 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "members": [ - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "initializer": { - "type": "BinaryExpression", - "operator": "<<", - "left": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "initializer": { - "type": "BinaryExpression", - "operator": "|", - "left": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "initializer": { - "type": "NumberLiteral", - "value": 6, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "F", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "initializer": { - "type": "MemberExpression", - "object": { - "type": "StringLiteral", - "value": "123", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 22 - } - } - } - ], - "const": false, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-enum-declaration.ts b/es2panda/test/parser/ts/test-enum-declaration.ts deleted file mode 100644 index e6d3b6a5bb434af04a5b74543723850aaa678ca5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -enum Foo { - A, - B = 5 << 4, - C, - D = B | C, - E = 6, - F = "123".length, -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-enum-declaration1-expected.txt b/es2panda/test/parser/ts/test-enum-declaration1-expected.txt deleted file mode 100644 index 7ad4b9386e25e8a16b9afd1448b576cdeb402bb1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Variable 'a' has already been declared. [test-enum-declaration1.ts:19:5] diff --git a/es2panda/test/parser/ts/test-enum-declaration1.ts b/es2panda/test/parser/ts/test-enum-declaration1.ts deleted file mode 100644 index 279e7d12d3e30d4983b04a98eecfb29c48741b4c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -enum foo { - a, - a = "bar", -} diff --git a/es2panda/test/parser/ts/test-enum-declaration2-expected.txt b/es2panda/test/parser/ts/test-enum-declaration2-expected.txt deleted file mode 100644 index 3ea32e6599d1b218be50185f3df4467b3604ec00..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token in enum member [test-enum-declaration2.ts:18:5] diff --git a/es2panda/test/parser/ts/test-enum-declaration2.ts b/es2panda/test/parser/ts/test-enum-declaration2.ts deleted file mode 100644 index 3d269306d3ddfc29b51fa802bb08fcc8a55ddfea..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -enum Foo { - 5 = 2, - B = "foo", -} diff --git a/es2panda/test/parser/ts/test-enum-declaration3-expected.txt b/es2panda/test/parser/ts/test-enum-declaration3-expected.txt deleted file mode 100644 index 96f233296f7c8e6f00bf38d68ed50a95d7f41496..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token in enum member [test-enum-declaration3.ts:18:12] diff --git a/es2panda/test/parser/ts/test-enum-declaration3.ts b/es2panda/test/parser/ts/test-enum-declaration3.ts deleted file mode 100644 index b01c86137bfb32f90407d51a63ac345b30c0bd6d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const enum Foo { - G = 1, 2, 3 -} diff --git a/es2panda/test/parser/ts/test-enum-declaration4-expected.txt b/es2panda/test/parser/ts/test-enum-declaration4-expected.txt deleted file mode 100644 index 255371edc36a3888eb005a7a3d70b0cfa028f499..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Variable 'Foo' has already been declared. [test-enum-declaration4.ts:20:10] diff --git a/es2panda/test/parser/ts/test-enum-declaration4.ts b/es2panda/test/parser/ts/test-enum-declaration4.ts deleted file mode 100644 index 9b28fe68fad7de60cbadd4d166076fc6e70b9328..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration4.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const enum Foo { -} - -enum Foo {} diff --git a/es2panda/test/parser/ts/test-enum-declaration5-expected.txt b/es2panda/test/parser/ts/test-enum-declaration5-expected.txt deleted file mode 100644 index 2b1842732b9453c9dd8a5df2f72cdfa989281248..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Variable 'Foo' has already been declared. [test-enum-declaration5.ts:19:16] diff --git a/es2panda/test/parser/ts/test-enum-declaration5.ts b/es2panda/test/parser/ts/test-enum-declaration5.ts deleted file mode 100644 index 43d8a7d1807c0b2c4eac300c11a25c44b8cdad77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration5.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -enum Foo {} - -const enum Foo { -} - diff --git a/es2panda/test/parser/ts/test-enum-declaration6-expected.txt b/es2panda/test/parser/ts/test-enum-declaration6-expected.txt deleted file mode 100644 index 8dbd9360c0c2ee8d13c1120e19e2ccec362a438f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration6-expected.txt +++ /dev/null @@ -1,362 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "ShiftE", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "members": [ - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "initializer": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "initializer": { - "type": "BinaryExpression", - "operator": "<<", - "left": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "initializer": { - "type": "BinaryExpression", - "operator": "<<", - "left": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "initializer": { - "type": "BinaryExpression", - "operator": "<<", - "left": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "initializer": { - "type": "BinaryExpression", - "operator": "<<", - "left": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 16 - } - } - } - ], - "const": false, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-enum-declaration6.ts b/es2panda/test/parser/ts/test-enum-declaration6.ts deleted file mode 100644 index 3fb14ee9947390d321df583b64d90925247a26c9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-enum-declaration6.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -enum ShiftE { - A = 1, - B = A << A, - C = B << 1, - D = C << B, - E = D << 2, -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-export-declaration1-expected.txt b/es2panda/test/parser/ts/test-export-declaration1-expected.txt deleted file mode 100644 index 6daf78f8cafa56100c1c7306a47ea51241e9c25f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration1-expected.txt +++ /dev/null @@ -1,131 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "exported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-export-declaration1.ts b/es2panda/test/parser/ts/test-export-declaration1.ts deleted file mode 100644 index a95638e9a10cc08458bf80498b8b15b43ae03580..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 1; -export {a}; diff --git a/es2panda/test/parser/ts/test-export-declaration2-expected.txt b/es2panda/test/parser/ts/test-export-declaration2-expected.txt deleted file mode 100644 index 0e4175004d17170a9966b56d659cd2321760c9f4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration2-expected.txt +++ /dev/null @@ -1,291 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "exported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 22, - "column": 4 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "exported": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-export-declaration2.ts b/es2panda/test/parser/ts/test-export-declaration2.ts deleted file mode 100644 index 885219d3424397f3005297552f1647f00b623667..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration2.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 1; -declare namespace ns { - export {a}; -} - -var b = 1; -export {b}; - diff --git a/es2panda/test/parser/ts/test-export-declaration3-expected.txt b/es2panda/test/parser/ts/test-export-declaration3-expected.txt deleted file mode 100644 index 6b060b92b887aedd7070747f8fa4a2ae027ff539..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration3-expected.txt +++ /dev/null @@ -1,394 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns1", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns2", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "exported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns1", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 17 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 21 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "exported": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 29, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-export-declaration3.ts b/es2panda/test/parser/ts/test-export-declaration3.ts deleted file mode 100644 index 6e002f4a6dbdc00beb2ca32d99800fda75bc35f7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration3.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -namespace ns1 { - declare namespace ns2 { - export {a}; - } -} - -namespace ns1 { - export var a = 1; -} - -var b = 1; -export {b}; diff --git a/es2panda/test/parser/ts/test-export-declaration4-expected.txt b/es2panda/test/parser/ts/test-export-declaration4-expected.txt deleted file mode 100644 index 41aff89ac3f7ca0ef5f3a123652941c5bea5b842..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Export name 'a' is not defined. [test-export-declaration4.ts:18:13] diff --git a/es2panda/test/parser/ts/test-export-declaration4.ts b/es2panda/test/parser/ts/test-export-declaration4.ts deleted file mode 100644 index 44c91379e90f4fc388b99514e72db4e81d65fef5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration4.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare namespace ns { - export {a}; -} - -var b = 1; -export {b}; diff --git a/es2panda/test/parser/ts/test-export-declaration5-expected.txt b/es2panda/test/parser/ts/test-export-declaration5-expected.txt deleted file mode 100644 index bb89b799093759f1548e8d09d6308935bd0e4916..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Export declarations are not permitted in a namespace. [test-export-declaration5.ts:19:12] diff --git a/es2panda/test/parser/ts/test-export-declaration5.ts b/es2panda/test/parser/ts/test-export-declaration5.ts deleted file mode 100644 index 91a7bdb6c58000009a9d60dbde7b1e2646b9eeeb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-declaration5.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -namespace ns { - var a; - export {a}; -} diff --git a/es2panda/test/parser/ts/test-export-function-expected.txt b/es2panda/test/parser/ts/test-export-function-expected.txt deleted file mode 100644 index be32c13693cb0f303e7cfabd1b34bbaaffe58b6d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-function-expected.txt +++ /dev/null @@ -1,284 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportDefaultDeclaration", - "declaration": { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - { - "type": "ExportDefaultDeclaration", - "declaration": { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - { - "type": "ExportDefaultDeclaration", - "declaration": { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 28 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 36 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-export-function.ts b/es2panda/test/parser/ts/test-export-function.ts deleted file mode 100644 index 6e3c765baf65d25152baa280c94638d0345fca0f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-function.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export default function f(x : number); -export default function f(x : string); -export default function f(x : any) {} - diff --git a/es2panda/test/parser/ts/test-export-interface-expected.txt b/es2panda/test/parser/ts/test-export-interface-expected.txt deleted file mode 100644 index 7dd4b25b02248ead5c4e464193effa56ffe2b0f4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-interface-expected.txt +++ /dev/null @@ -1,116 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "exported": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-export-interface.ts b/es2panda/test/parser/ts/test-export-interface.ts deleted file mode 100644 index 0bbb873b9928c3147edb37e23603054745894e63..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-interface.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I {} -export {type I} diff --git a/es2panda/test/parser/ts/test-export-type-expected.txt b/es2panda/test/parser/ts/test-export-type-expected.txt deleted file mode 100644 index 27b98d3d6894066551415a55019e5cd31615f184..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-type-expected.txt +++ /dev/null @@ -1,243 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "exported": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - } - ], - "isType": true, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": { - "type": "StringLiteral", - "value": "./C", - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "exported": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - } - } - ], - "isType": true, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-export-type.ts b/es2panda/test/parser/ts/test-export-type.ts deleted file mode 100644 index 222885cb5a2e6ea6dbed691198c32fb89b433bb2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-export-type.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export type a = number; -type b = string; -export type {b}; -export type {c} from "./C"; diff --git a/es2panda/test/parser/ts/test-func-decl1-expected.txt b/es2panda/test/parser/ts/test-func-decl1-expected.txt deleted file mode 100644 index 1220808d5012f75bc375048b1af732ba04d1ea7d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-decl1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Private identifiers are not allowed outside class bodies. [test-func-decl1.ts:18:10] diff --git a/es2panda/test/parser/ts/test-func-decl1.ts b/es2panda/test/parser/ts/test-func-decl1.ts deleted file mode 100644 index e2848e475789de09dc12c65c8f20ebc3909dccfe..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-decl1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo() { - this.#bar = "baz"; -} diff --git a/es2panda/test/parser/ts/test-func-param-expected.txt b/es2panda/test/parser/ts/test-func-param-expected.txt deleted file mode 100644 index 6346625ed9a3bcf9026f196c26eb13e4ec1b2d4e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param-expected.txt +++ /dev/null @@ -1,2260 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func2", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "right": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 38 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 35 - }, - "end": { - "line": 18, - "column": 39 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 51 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func3", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 6, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, - { - "type": "Identifier", - "name": "b", - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 32 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func4", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "properties": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 34 - } - } - } - ], - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 37 - }, - "end": { - "line": 20, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 37 - }, - "end": { - "line": 20, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 35 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 47 - }, - "end": { - "line": 20, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 50 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func5", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 21 - } - } - } - ], - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 33 - }, - "end": { - "line": 21, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 21, - "column": 44 - }, - "end": { - "line": 21, - "column": 45 - } - } - }, - { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 21, - "column": 47 - }, - "end": { - "line": 21, - "column": 52 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 43 - }, - "end": { - "line": 21, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 53 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 55 - }, - "end": { - "line": 21, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 58 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func6", - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 22 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 28 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 31 - }, - "end": { - "line": 22, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 28 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 39 - }, - "end": { - "line": 22, - "column": 40 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 42 - }, - "end": { - "line": 22, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 39 - }, - "end": { - "line": 22, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 55 - }, - "end": { - "line": 22, - "column": 56 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 22, - "column": 58 - }, - "end": { - "line": 22, - "column": 59 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 55 - }, - "end": { - "line": 22, - "column": 59 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 61 - }, - "end": { - "line": 22, - "column": 62 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 22, - "column": 64 - }, - "end": { - "line": 22, - "column": 65 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 61 - }, - "end": { - "line": 22, - "column": 65 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 53 - }, - "end": { - "line": 22, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 67 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 22, - "column": 69 - }, - "end": { - "line": 22, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 72 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func7", - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 29 - } - } - } - ], - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 33 - }, - "end": { - "line": 23, - "column": 39 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 41 - }, - "end": { - "line": 23, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 32 - }, - "end": { - "line": 23, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 30 - } - } - } - ], - "declare": true, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 24, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 24, - "column": 8 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func8", - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 24, - "column": 36 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 39 - }, - "end": { - "line": 24, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 36 - }, - "end": { - "line": 24, - "column": 46 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 24, - "column": 47 - }, - "end": { - "line": 24, - "column": 48 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 50 - }, - "end": { - "line": 24, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 47 - }, - "end": { - "line": 24, - "column": 58 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 34 - }, - "end": { - "line": 24, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 24 - }, - "end": { - "line": 24, - "column": 32 - } - } - } - ], - "declare": true, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func9", - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 25, - "column": 28 - }, - "end": { - "line": 25, - "column": 29 - } - } - } - ], - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 34 - }, - "end": { - "line": 25, - "column": 40 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 25, - "column": 42 - }, - "end": { - "line": 25, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 33 - }, - "end": { - "line": 25, - "column": 49 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 25, - "column": 24 - }, - "end": { - "line": 25, - "column": 30 - } - } - } - ], - "declare": true, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func10", - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 26, - "column": 27 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 26, - "column": 27 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 26, - "column": 27 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 30 - }, - "end": { - "line": 26, - "column": 31 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 30 - }, - "end": { - "line": 26, - "column": 31 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 26, - "column": 30 - }, - "end": { - "line": 26, - "column": 31 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 26, - "column": 38 - }, - "end": { - "line": 26, - "column": 39 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 26, - "column": 41 - }, - "end": { - "line": 26, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 38 - }, - "end": { - "line": 26, - "column": 48 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 49 - }, - "end": { - "line": 26, - "column": 50 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 26, - "column": 52 - }, - "end": { - "line": 26, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 49 - }, - "end": { - "line": 26, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 36 - }, - "end": { - "line": 26, - "column": 60 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 26, - "column": 25 - }, - "end": { - "line": 26, - "column": 33 - } - } - } - ], - "declare": true, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 7 - } - } - }, - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - "value": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 23 - } - } - }, - "value": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 23 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 23 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": true, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 30, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": true, - "readonly": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 25 - } - } - } - ], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 32, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface1", - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 33, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 33, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-func-param.ts b/es2panda/test/parser/ts/test-func-param.ts deleted file mode 100644 index bc13c5129d86d69cf726cf6c3755a8b45f56f4cf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function func1(a: number, b: string) { } -function func2(a: boolean = true, ...b: number[]) { } -function func3(a = 6, [c, d], b?) { } -function func4({ }: number, [a, b]: string[]) { } -function func5([a, b]: [number, string] = [1, "foo"]) { } -function func6({ a, b }: { a: number, b: number } = { a: 0, b: 0 }) { } -declare function func7([a, b]: [number, string]) -declare function func8({ a, b }: { a: number, b: number }) -declare function func9([a, b]?: [number, string]) -declare function func10({ a, b }?: { a: number, b: number }) - -interface Interface1 { - (a: number, { b, c }?: { - b?: boolean; - c?: any; - }): string; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param1-expected.txt b/es2panda/test/parser/ts/test-func-param1-expected.txt deleted file mode 100644 index ba224fb3f4fac9782e8a95ce436c0cac5c729c74..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A required parameter cannot follow an optional parameter [test-func-param1.ts:17:22] diff --git a/es2panda/test/parser/ts/test-func-param1.ts b/es2panda/test/parser/ts/test-func-param1.ts deleted file mode 100644 index be7d57a665c133d07fcd9d7010ace969b1cc8a40..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(a, b?, c) { - -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param2-expected.txt b/es2panda/test/parser/ts/test-func-param2-expected.txt deleted file mode 100644 index dd6edfacd1357e50b57835088d2b4abfb758fdd4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'this' parameter must be the first parameter [test-func-param2.ts:17:21] diff --git a/es2panda/test/parser/ts/test-func-param2.ts b/es2panda/test/parser/ts/test-func-param2.ts deleted file mode 100644 index a1b2eaf082e2e7af71c4cbe7904f84cc2147e178..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(a, this) { - -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param3-expected.txt b/es2panda/test/parser/ts/test-func-param3-expected.txt deleted file mode 100644 index 8c0b648190aa25b228493f6b649343157de0553b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A constructor cannot have a 'this' parameter [test-func-param3.ts:18:21] diff --git a/es2panda/test/parser/ts/test-func-param3.ts b/es2panda/test/parser/ts/test-func-param3.ts deleted file mode 100644 index c07c1ae0976e197c601d6e7ff29b609c65f947ed..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - constructor(this) { } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param4-expected.txt b/es2panda/test/parser/ts/test-func-param4-expected.txt deleted file mode 100644 index a9eb4575fc942cf9adb17461f87181004182b550..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'get' and 'set' accessors cannot declare 'this' parameters [test-func-param4.ts:18:17] diff --git a/es2panda/test/parser/ts/test-func-param4.ts b/es2panda/test/parser/ts/test-func-param4.ts deleted file mode 100644 index ce5d745090d6e68f16ac7e285cf4d91ebea96789..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - get foo(this) { return; } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param5-expected.txt b/es2panda/test/parser/ts/test-func-param5-expected.txt deleted file mode 100644 index d70b2b42b96e1193a45a81279261a801dce192a0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'constructor' cannot be used as a parameter property name [test-func-param5.ts:18:28] diff --git a/es2panda/test/parser/ts/test-func-param5.ts b/es2panda/test/parser/ts/test-func-param5.ts deleted file mode 100644 index a6dc7e44c2bb853a75a1d662ed8c1c313cc0d1df..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param5.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - constructor(constructor) { } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param6-expected.txt b/es2panda/test/parser/ts/test-func-param6-expected.txt deleted file mode 100644 index 80e060a4f5c4068a8b4b81d63851914b554abe88..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A binding pattern parameter cannot be optional in an implementation signature [test-func-param6.ts:17:14] diff --git a/es2panda/test/parser/ts/test-func-param6.ts b/es2panda/test/parser/ts/test-func-param6.ts deleted file mode 100644 index 9c1f00939e25a6a0b85da0e7e3d557d04213e2a9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo([]?) { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param7-expected.txt b/es2panda/test/parser/ts/test-func-param7-expected.txt deleted file mode 100644 index 51cc6c35e33f78901c622bb633407718364a3e15..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A rest parameter cannot be optional [test-func-param7.ts:17:18] diff --git a/es2panda/test/parser/ts/test-func-param7.ts b/es2panda/test/parser/ts/test-func-param7.ts deleted file mode 100644 index 14852d8aebd432b851649a698141fb74de2c9007..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(...a?) { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param8-expected.txt b/es2panda/test/parser/ts/test-func-param8-expected.txt deleted file mode 100644 index f364c1096a4cfa0ec48338e0b4ad8ed25e3efc22..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Parameter cannot have question mark and initializer [test-func-param8.ts:17:16] diff --git a/es2panda/test/parser/ts/test-func-param8.ts b/es2panda/test/parser/ts/test-func-param8.ts deleted file mode 100644 index e0b5280302839dc500c536972d5c5eeaa41abc98..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param8.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(a?= 5) { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-func-param9-expected.txt b/es2panda/test/parser/ts/test-func-param9-expected.txt deleted file mode 100644 index 12787e7c954dcebbbc6da62533cb63f0815b4e6c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param9-expected.txt +++ /dev/null @@ -1,256 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - } - ], - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 17 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 18 - } - } - } - ], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 34 - } - } -} diff --git a/es2panda/test/parser/ts/test-func-param9.ts b/es2panda/test/parser/ts/test-func-param9.ts deleted file mode 100644 index ea6d3e316a51c6271942b8a7523c8d8344f49f42..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-func-param9.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo([x]?:[number]) : number; -function foo(...a:any[]) : any {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-function-generic-expected.txt b/es2panda/test/parser/ts/test-function-generic-expected.txt deleted file mode 100644 index 9be1f6f7670b4d785827a4c51ce0076270fcd56e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-generic-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Identifier expected. [test-function-generic.ts:21:13] diff --git a/es2panda/test/parser/ts/test-function-generic.ts b/es2panda/test/parser/ts/test-function-generic.ts deleted file mode 100644 index b327e9e1ebe6196a28c3178110eaf88fe20cfe65..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-generic.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function func (a : T) { - console.log(a); -} - -func(10); diff --git a/es2panda/test/parser/ts/test-function-name-1-expected.txt b/es2panda/test/parser/ts/test-function-name-1-expected.txt deleted file mode 100644 index 0b4e7c5b9973fff421d41c3c49178a3b47593b28..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-name-1-expected.txt +++ /dev/null @@ -1,213 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "is", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "asserts", - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-function-name-1.ts b/es2panda/test/parser/ts/test-function-name-1.ts deleted file mode 100644 index 879f52ec15805572c14f420738930e6c7140dbac..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-name-1.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function is(): string { - return "is"; -} - -function asserts(): string { - return "asserts"; -} diff --git a/es2panda/test/parser/ts/test-function-overload-expected.txt b/es2panda/test/parser/ts/test-function-overload-expected.txt deleted file mode 100644 index 20051826ceaba60aef3b2e96cc7798c409023e3b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-overload-expected.txt +++ /dev/null @@ -1,454 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 45 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 26 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 38 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 46 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 39 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 47 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 19 - } - } -} diff --git a/es2panda/test/parser/ts/test-function-overload.ts b/es2panda/test/parser/ts/test-function-overload.ts deleted file mode 100644 index 6de3f1be06106f078398a68fcd86c8daabed8702..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-overload.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(a: number, b: string): boolean; -function foo(a: number, b?: string): boolean; -function foo(a?: number, b?: string): boolean { - return true; -} - -function bar() { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-function-overload1-expected.txt b/es2panda/test/parser/ts/test-function-overload1-expected.txt deleted file mode 100644 index 60a3de5371ec03f076524c3e6be103ceaaca16b8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-overload1-expected.txt +++ /dev/null @@ -1,147 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } -} diff --git a/es2panda/test/parser/ts/test-function-overload1.ts b/es2panda/test/parser/ts/test-function-overload1.ts deleted file mode 100644 index 2923655b0c5f6201167d397fef7e8581751638fd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-overload1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(); -function foo(); -function foo(); \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-function-overload2-expected.txt b/es2panda/test/parser/ts/test-function-overload2-expected.txt deleted file mode 100644 index 9c9fb8beabc0a8ddb32180784f3fa6aef8248629..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-overload2-expected.txt +++ /dev/null @@ -1,161 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 19 - } - } -} diff --git a/es2panda/test/parser/ts/test-function-overload2.ts b/es2panda/test/parser/ts/test-function-overload2.ts deleted file mode 100644 index 85f0070e4305bb4e8a1139863c6df76f197f647a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-overload2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function bar(); -function bar(); -function foo() { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt b/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt deleted file mode 100644 index 86e97f3eead4ee136bb04e58d59bcfb5cedbd17d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-with-type-assertion-expected.txt +++ /dev/null @@ -1,1032 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "accessibility": "private", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 23 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Derived1", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 43 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "accessibility": "private", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 40 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 43 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 43 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d1", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d2", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Derived1", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 41 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "init": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [], - "returnType": { - "type": "TSArrayType", - "elementType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Base", - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "expression": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ArrayExpression", - "elements": [ - { - "type": "Identifier", - "name": "d1", - "loc": { - "start": { - "line": 19, - "column": 48 - }, - "end": { - "line": 19, - "column": 50 - } - } - }, - { - "type": "Identifier", - "name": "d2", - "loc": { - "start": { - "line": 19, - "column": 52 - }, - "end": { - "line": 19, - "column": 54 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 47 - }, - "end": { - "line": 19, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 40 - }, - "end": { - "line": 19, - "column": 55 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 58 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "func2", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "init": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "arg0", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Number", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Number", - "loc": { - "start": { - "line": 20, - "column": 32 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 32 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "expression": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Number", - "loc": { - "start": { - "line": 20, - "column": 51 - }, - "end": { - "line": 20, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 51 - }, - "end": { - "line": 20, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 48 - }, - "end": { - "line": 20, - "column": 49 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 68 - }, - "end": { - "line": 20, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 61 - }, - "end": { - "line": 20, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 59 - }, - "end": { - "line": 20, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 39 - }, - "end": { - "line": 20, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 39 - }, - "end": { - "line": 20, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 72 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 72 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 72 - } - } -} diff --git a/es2panda/test/parser/ts/test-function-with-type-assertion.ts b/es2panda/test/parser/ts/test-function-with-type-assertion.ts deleted file mode 100644 index 8f4a2f8056818b0c2d4fd25c28b11f133013abcb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-function-with-type-assertion.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -class Base { private p; } -class Derived1 extends Base { private m; } -var d1 = new Base(), d2 = new Derived1(); -var func1 = <() => Base[]>function() { return [d1, d2] }; -var func2 = <(arg0: Number) => Number>function(a: Number) { return a }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-if-expected.txt b/es2panda/test/parser/ts/test-if-expected.txt deleted file mode 100644 index 50e04b9cb34448d46690e401d646e7a7355db0cb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-if-expected.txt +++ /dev/null @@ -1,156 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "IfStatement", - "test": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "consequent": { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "members": [], - "const": true, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "alternate": { - "type": "IfStatement", - "test": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "consequent": { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "members": [], - "const": true, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "alternate": { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "members": [], - "const": true, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 22, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-if.ts b/es2panda/test/parser/ts/test-if.ts deleted file mode 100644 index df1aa01a5ed4edbc24949a3cb144e3d088b9558e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-if.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -if (1) - const enum A { } -else if (2) - const enum B { } -else - const enum C { } diff --git a/es2panda/test/parser/ts/test-import-type-expected.txt b/es2panda/test/parser/ts/test-import-type-expected.txt deleted file mode 100644 index d94c211a66e308bcec847284ea6b39a8f54041a8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-import-type-expected.txt +++ /dev/null @@ -1,257 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "./A", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "imported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "isType": true, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "./B", - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 14 - } - } - } - ], - "isType": true, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "./C", - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "specifiers": [ - { - "type": "ImportNamespaceSpecifier", - "local": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "isType": true, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 31 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "./D", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-import-type-source-expected.txt b/es2panda/test/parser/ts/test-import-type-source-expected.txt deleted file mode 100644 index 253e24ed13422d8882880f6710bb639e684e9c44..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-import-type-source-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token. [test-import-type-source.ts:17:13] diff --git a/es2panda/test/parser/ts/test-import-type-source.ts b/es2panda/test/parser/ts/test-import-type-source.ts deleted file mode 100644 index 492685d3fb45511aec035a4fdf3958a7ee24a8dd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-import-type-source.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import type './export' diff --git a/es2panda/test/parser/ts/test-import-type.ts b/es2panda/test/parser/ts/test-import-type.ts deleted file mode 100644 index 6b5fbe4b80f3a95241cff3bb1ee603bb50fcf96a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-import-type.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import type {a} from "./A"; -import type b from "./B"; -import type * as c from "./C"; -import type from "./D"; diff --git a/es2panda/test/parser/ts/test-indexSignature1-expected.txt b/es2panda/test/parser/ts/test-indexSignature1-expected.txt deleted file mode 100644 index eb25553b18f53301138495f48d004c5e9769cff2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-indexSignature1-expected.txt +++ /dev/null @@ -1,1177 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k1", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k2", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k3", - "typeAnnotation": { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k4", - "typeAnnotation": { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 29 - }, - "end": { - "line": 27, - "column": 35 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "templateLiteral-", - "cooked": "templateLiteral-" - }, - "loc": { - "start": { - "line": 27, - "column": 11 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 27, - "column": 36 - }, - "end": { - "line": 27, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 27, - "column": 40 - }, - "end": { - "line": 27, - "column": 47 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k1", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 10 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 21 - } - } - }, - "right": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 31, - "column": 26 - }, - "end": { - "line": 31, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 26 - }, - "end": { - "line": 31, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 10 - }, - "end": { - "line": 31, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 31, - "column": 30 - }, - "end": { - "line": 31, - "column": 37 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I2", - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 13 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 34, - "column": 7 - }, - "end": { - "line": 34, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 36, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k1", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 35, - "column": 10 - }, - "end": { - "line": 35, - "column": 16 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 35, - "column": 19 - }, - "end": { - "line": 35, - "column": 25 - } - } - }, - { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 35, - "column": 28 - }, - "end": { - "line": 35, - "column": 34 - } - } - }, - { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 35, - "column": 56 - }, - "end": { - "line": 35, - "column": 62 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "templateLiteral-", - "cooked": "templateLiteral-" - }, - "loc": { - "start": { - "line": 35, - "column": 38 - }, - "end": { - "line": 35, - "column": 54 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 35, - "column": 63 - }, - "end": { - "line": 35, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 37 - }, - "end": { - "line": 35, - "column": 64 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 10 - }, - "end": { - "line": 35, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 6 - }, - "end": { - "line": 35, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 35, - "column": 67 - }, - "end": { - "line": 35, - "column": 74 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 36, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 36, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "k", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 38, - "column": 22 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 25 - }, - "end": { - "line": 38, - "column": 31 - } - } - }, - { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 38, - "column": 34 - }, - "end": { - "line": 38, - "column": 40 - } - } - }, - { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 38, - "column": 62 - }, - "end": { - "line": 38, - "column": 68 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "templateLiteral-", - "cooked": "templateLiteral-" - }, - "loc": { - "start": { - "line": 38, - "column": 44 - }, - "end": { - "line": 38, - "column": 60 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 38, - "column": 69 - }, - "end": { - "line": 38, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 43 - }, - "end": { - "line": 38, - "column": 70 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 38, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 38, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 38, - "column": 73 - }, - "end": { - "line": 38, - "column": 80 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 38, - "column": 12 - }, - "end": { - "line": 38, - "column": 82 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 10 - }, - "end": { - "line": 38, - "column": 82 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 7 - }, - "end": { - "line": 38, - "column": 8 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 38, - "column": 85 - }, - "end": { - "line": 38, - "column": 87 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 7 - }, - "end": { - "line": 38, - "column": 87 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 38, - "column": 1 - }, - "end": { - "line": 38, - "column": 88 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 39, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-indexSignature1.ts b/es2panda/test/parser/ts/test-indexSignature1.ts deleted file mode 100644 index 825967df3ee6bf80255fa43afbd579cd652e6242..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-indexSignature1.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type a = symbol; - -namespace ns { - export type a = string -} - -interface I1 { - [k1: string]: boolean; - [k2: number]: boolean; - [k3: symbol]: boolean; - [k4: `templateLiteral-${string}`]: boolean; -} - -interface I2 { - [k1: number | ns.a | a]: boolean; -} - -class A { - [k1: string | number | symbol | `templateLiteral-${string}`]: boolean; -} - -const x: { [k: string | number | symbol | `templateLiteral-${string}`]: boolean } = {}; diff --git a/es2panda/test/parser/ts/test-indexSignature2-expected.txt b/es2panda/test/parser/ts/test-indexSignature2-expected.txt deleted file mode 100644 index 414f832a0c852d06d76875850adeb800de982c30..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-indexSignature2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type. [test-indexSignature2.ts:18:16] diff --git a/es2panda/test/parser/ts/test-indexSignature2.ts b/es2panda/test/parser/ts/test-indexSignature2.ts deleted file mode 100644 index 0bb7759283b910caff764e129d66ca660f6264e6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-indexSignature2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I1 { - [k: boolean]: boolean; -} diff --git a/es2panda/test/parser/ts/test-indexSignature3-expected.txt b/es2panda/test/parser/ts/test-indexSignature3-expected.txt deleted file mode 100644 index a8535dec21a6dcf6334c8007629a49f634901f10..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-indexSignature3-expected.txt +++ /dev/null @@ -1,877 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 42 - }, - "end": { - "line": 18, - "column": 49 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 19, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 19, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 4 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "extendsType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 36 - }, - "end": { - "line": 22, - "column": 42 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 45 - }, - "end": { - "line": 22, - "column": 51 - } - } - }, - "falseType": { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 22, - "column": 54 - }, - "end": { - "line": 22, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 22, - "column": 63 - }, - "end": { - "line": 22, - "column": 70 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 23, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "I2", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 25, - "column": 8 - }, - "end": { - "line": 25, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 3 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSIndexedAccessType", - "objectType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 13 - } - } - }, - "indexType": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 29, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 16 - }, - "end": { - "line": 29, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "I3", - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 27, - "column": 3 - }, - "end": { - "line": 29, - "column": 4 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 17 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 32, - "column": 20 - }, - "end": { - "line": 32, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 6 - }, - "end": { - "line": 32, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 32, - "column": 29 - }, - "end": { - "line": 32, - "column": 36 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 33, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 33, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "I4", - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 15 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 31, - "column": 3 - }, - "end": { - "line": 33, - "column": 4 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 36, - "column": 11 - }, - "end": { - "line": 36, - "column": 17 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 36, - "column": 22 - }, - "end": { - "line": 36, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 20 - }, - "end": { - "line": 36, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 11 - }, - "end": { - "line": 36, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 6 - }, - "end": { - "line": 36, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 36, - "column": 31 - }, - "end": { - "line": 36, - "column": 38 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 37, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 37, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "I5", - "loc": { - "start": { - "line": 35, - "column": 13 - }, - "end": { - "line": 35, - "column": 15 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 35, - "column": 3 - }, - "end": { - "line": 37, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 38, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-indexSignature3.ts b/es2panda/test/parser/ts/test-indexSignature3.ts deleted file mode 100644 index ac4fdcbef9f18a087fc3c20762cc212ebcfd9da9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-indexSignature3.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I1 { - [key: (string | (number | number))]: boolean - } - - interface I2 { - [key: boolean & number extends string ? number : symbol]: boolean - } - - type A = { a: number } - - interface I3 { - [key: A["a"]]: boolean - } - - interface I4 { - [key: string & string]: boolean - } - - interface I5 { - [key: string | & string]: boolean - } diff --git a/es2panda/test/parser/ts/test-interface-expected.txt b/es2panda/test/parser/ts/test-interface-expected.txt deleted file mode 100644 index 977a45f2ead515a00f5f33dcd2ce9d6b5702fe88..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface-expected.txt +++ /dev/null @@ -1,793 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": true, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 20, - "column": 25 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 23 - } - } - } - ], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 34 - }, - "end": { - "line": 20, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 7 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 46 - }, - "end": { - "line": 20, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 46 - }, - "end": { - "line": 20, - "column": 54 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 20, - "column": 42 - }, - "end": { - "line": 20, - "column": 43 - } - } - } - ], - "typeAnnotation": { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 20, - "column": 57 - }, - "end": { - "line": 20, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 67 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, - { - "type": "TSConstructSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNullKeyword", - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 33 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 36 - }, - "end": { - "line": 23, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 33 - }, - "end": { - "line": 23, - "column": 43 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 44 - }, - "end": { - "line": 23, - "column": 45 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 47 - }, - "end": { - "line": 23, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 44 - }, - "end": { - "line": 23, - "column": 54 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": true, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 23, - "column": 55 - }, - "end": { - "line": 23, - "column": 56 - } - } - }, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 59 - }, - "end": { - "line": 23, - "column": 60 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 62 - }, - "end": { - "line": 23, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 58 - }, - "end": { - "line": 23, - "column": 64 - } - } - } - ], - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 67 - }, - "end": { - "line": 23, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 55 - }, - "end": { - "line": 23, - "column": 75 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 31 - }, - "end": { - "line": 23, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [ - { - "type": "TSInterfaceHeritage", - "expression": { - "type": "TSTypeReference", - "typeName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "right": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt b/es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt deleted file mode 100644 index c20924fa36cae3062e45895afb97bccfc173cb17..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface-method-identifier1-expected.txt +++ /dev/null @@ -1,689 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "then", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "success", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 29 - } - } - } - ], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 18, - "column": 37 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 37 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 48 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 18, - "column": 49 - }, - "end": { - "line": 18, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 49 - }, - "end": { - "line": 18, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 48 - }, - "end": { - "line": 18, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "then", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "success", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 29 - } - } - } - ], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 19, - "column": 37 - }, - "end": { - "line": 19, - "column": 44 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 45 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 45 - }, - "end": { - "line": 19, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 44 - }, - "end": { - "line": 19, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 37 - }, - "end": { - "line": 19, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 44 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 58 - }, - "end": { - "line": 19, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 58 - }, - "end": { - "line": 19, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 57 - }, - "end": { - "line": 19, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 61 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "value", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "extends": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-interface-method-identifier1.ts b/es2panda/test/parser/ts/test-interface-method-identifier1.ts deleted file mode 100644 index d00de1478a4668fe64198b85885e45a153cf66a4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface-method-identifier1.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Promise { - then(success?: (value: T) => U): Promise; - then(success?: (value: T) => Promise): Promise; - value: T; -} diff --git a/es2panda/test/parser/ts/test-interface.ts b/es2panda/test/parser/ts/test-interface.ts deleted file mode 100644 index 1072c19fd2286976ffa52f562eecc23f9629a416..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface foo extends a.b { - a?: number, - b: string | boolean; - c(a: (a: number, b: void) => string, b?: number[]): undefined; - (a: string): string, - (a: number): number, - new(a: null, b?: string): { a: number, b: string, c?([a, b]): string } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-interface1-expected.txt b/es2panda/test/parser/ts/test-interface1-expected.txt deleted file mode 100644 index 4275ded626b9aa2164508bc2ac2fb0a3b74a7bdd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Interface name cannot be 'boolean' [test-interface1.ts:17:11] diff --git a/es2panda/test/parser/ts/test-interface1.ts b/es2panda/test/parser/ts/test-interface1.ts deleted file mode 100644 index 09f0b32a7d175dc58bbf19c6c929efccb0be1416..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface boolean { - -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-interface2-expected.txt b/es2panda/test/parser/ts/test-interface2-expected.txt deleted file mode 100644 index 45fa92dda52ac38c1138f53b2322ba3aba1f6441..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-interface2.ts:17:11] diff --git a/es2panda/test/parser/ts/test-interface2.ts b/es2panda/test/parser/ts/test-interface2.ts deleted file mode 100644 index 3b9d59fdb93f0ab01f862db9a18368e67f141c45..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface 5 { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-interface3-expected.txt b/es2panda/test/parser/ts/test-interface3-expected.txt deleted file mode 100644 index aee0ef40e2527f1d1bcf7eaba1622b7019b4ebc7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Identifier expected [test-interface3.ts:17:23] diff --git a/es2panda/test/parser/ts/test-interface3.ts b/es2panda/test/parser/ts/test-interface3.ts deleted file mode 100644 index e56398657f366e64f6bbe92d33aa84b88635d325..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface foo extends 5 { - -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-interface4-expected.txt b/es2panda/test/parser/ts/test-interface4-expected.txt deleted file mode 100644 index 2854b5dddc41d5544098ff93c598cfd296b037c6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface4-expected.txt +++ /dev/null @@ -1,203 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-interface4.ts b/es2panda/test/parser/ts/test-interface4.ts deleted file mode 100644 index 7f4ee18bb1847848a2dffb0643e6125e6111bb20..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface4.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I { - func(a: any, b: any): number - is(): boolean; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-interface5-expected.txt b/es2panda/test/parser/ts/test-interface5-expected.txt deleted file mode 100644 index af69ea15f7c3779413dca7b63ca606c4797c1551..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface5-expected.txt +++ /dev/null @@ -1,184 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 20 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-interface5.ts b/es2panda/test/parser/ts/test-interface5.ts deleted file mode 100644 index 83d31f787015d99a5e2d78ada519730bad5a5e2d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-interface5.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I { - a : string | - number - [b : number] : string; -} diff --git a/es2panda/test/parser/ts/test-intersection-expected.txt b/es2panda/test/parser/ts/test-intersection-expected.txt deleted file mode 100644 index 48c78d11296ace879b3a513a93466988c0b20e25..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection-expected.txt +++ /dev/null @@ -1,1654 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "F", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type1", - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 27 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 27 - }, - "end": { - "line": 24, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 36 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type2", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 15 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 25, - "column": 30 - }, - "end": { - "line": 25, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 30 - }, - "end": { - "line": 25, - "column": 31 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 25, - "column": 35 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 35 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 25, - "column": 39 - }, - "end": { - "line": 25, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 39 - }, - "end": { - "line": 25, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 35 - }, - "end": { - "line": 25, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 34 - }, - "end": { - "line": 25, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 30 - }, - "end": { - "line": 25, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 26, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type3", - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 19 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 26, - "column": 30 - }, - "end": { - "line": 26, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 30 - }, - "end": { - "line": 26, - "column": 31 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 26, - "column": 34 - }, - "end": { - "line": 26, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 34 - }, - "end": { - "line": 26, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 30 - }, - "end": { - "line": 26, - "column": 35 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 26, - "column": 38 - }, - "end": { - "line": 26, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 38 - }, - "end": { - "line": 26, - "column": 39 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 26, - "column": 42 - }, - "end": { - "line": 26, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 42 - }, - "end": { - "line": 26, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 38 - }, - "end": { - "line": 26, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 44 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type4", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 25 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type5", - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 28, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 26 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 28, - "column": 29 - }, - "end": { - "line": 28, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 29 - }, - "end": { - "line": 28, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 31 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 28, - "column": 34 - }, - "end": { - "line": 28, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 34 - }, - "end": { - "line": 28, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 35 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "F", - "loc": { - "start": { - "line": 28, - "column": 38 - }, - "end": { - "line": 28, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 38 - }, - "end": { - "line": 28, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 8 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 30, - "column": 19 - } - } -} diff --git a/es2panda/test/parser/ts/test-intersection.ts b/es2panda/test/parser/ts/test-intersection.ts deleted file mode 100644 index 87ba8cb25a25f5655052e2316f3f4034d19bada9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type A = string; -type B = string; -type C = string; -type D = string; -type E = string; -type F = string; - -type Type1 = (A | & B) & (& C | D); -type Type2 = A & (| C | D) | B & (C | D) -type Type3 = A & C | A & D | B & C | B & D; -type Type4 = A & (B & C) & D; -type Type5 = (A | (B & C) & D) & E | F; - -var a: | & string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-intersection1-expected.txt b/es2panda/test/parser/ts/test-intersection1-expected.txt deleted file mode 100644 index b1a3b334fae0bc0c7c74b45b92e46c3b3b69f980..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-intersection1.ts:17:10] diff --git a/es2panda/test/parser/ts/test-intersection1.ts b/es2panda/test/parser/ts/test-intersection1.ts deleted file mode 100644 index 557f5292023b24120b2a8bb8405ab3c929853711..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: & | string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-intersection2-expected.txt b/es2panda/test/parser/ts/test-intersection2-expected.txt deleted file mode 100644 index cdc7e28cffaa5fc48ac62cd34df577162d66d4f9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-intersection2.ts:17:10] diff --git a/es2panda/test/parser/ts/test-intersection2.ts b/es2panda/test/parser/ts/test-intersection2.ts deleted file mode 100644 index ae6eb195cc042d71cea16d6ab5eb140578629868..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: & & string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-intersection3-expected.txt b/es2panda/test/parser/ts/test-intersection3-expected.txt deleted file mode 100644 index 0f4cc23c5ee4d6ed1269c918ea3b6b026fa2c2ad..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-intersection3.ts:17:16] diff --git a/es2panda/test/parser/ts/test-intersection3.ts b/es2panda/test/parser/ts/test-intersection3.ts deleted file mode 100644 index cc11fef3f5981badd5f762f5cfea8d251b0ff200..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-intersection3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: string &; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare-expected.txt b/es2panda/test/parser/ts/test-keyword-declare-expected.txt deleted file mode 100644 index f327637d6fada515b99e0a38e0cc49cd9d5532f1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare-expected.txt +++ /dev/null @@ -1,1186 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var1", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var2", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 17 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var3", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 9 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var4", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 17 - } - } - } - ], - "kind": "let", - "declare": true, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var5", - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 15 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var6", - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 23 - } - } - } - ], - "kind": "const", - "declare": true, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var7", - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 19 - } - } - } - ], - "kind": "const", - "declare": true, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 20 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "type1", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "type2", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 28 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 28, - "column": 31 - }, - "end": { - "line": 28, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 37 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 38 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 30, - "column": 21 - }, - "end": { - "line": 30, - "column": 22 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func2", - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func2", - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 9 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Class1", - "loc": { - "start": { - "line": 34, - "column": 15 - }, - "end": { - "line": 34, - "column": 21 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 45, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 35, - "column": 24 - }, - "end": { - "line": 35, - "column": 25 - } - } - }, - "kind": "get", - "accessibility": "private", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 35, - "column": 25 - }, - "end": { - "line": 36, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 25 - }, - "end": { - "line": 36, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 36, - "column": 11 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "g", - "loc": { - "start": { - "line": 36, - "column": 12 - }, - "end": { - "line": 36, - "column": 13 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 36, - "column": 13 - }, - "end": { - "line": 37, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 13 - }, - "end": { - "line": 37, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 37, - "column": 11 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 37, - "column": 30 - }, - "end": { - "line": 37, - "column": 31 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": true, - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 31 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 38, - "column": 30 - }, - "end": { - "line": 38, - "column": 33 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": true, - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 33 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "NumberLiteral", - "value": 67, - "loc": { - "start": { - "line": 39, - "column": 29 - }, - "end": { - "line": 39, - "column": 31 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 31 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "j", - "loc": { - "start": { - "line": 40, - "column": 29 - }, - "end": { - "line": 40, - "column": 30 - } - } - }, - "static": true, - "readonly": true, - "declare": true, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 30 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "private", - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 12 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 12 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 42, - "column": 16 - }, - "end": { - "line": 42, - "column": 17 - } - } - }, - "kind": "method", - "accessibility": "protected", - "static": false, - "optional": false, - "computed": true, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 42, - "column": 18 - }, - "end": { - "line": 43, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 18 - }, - "end": { - "line": 43, - "column": 11 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 43, - "column": 11 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 43, - "column": 19 - }, - "end": { - "line": 43, - "column": 20 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 20 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "o", - "loc": { - "start": { - "line": 44, - "column": 5 - }, - "end": { - "line": 44, - "column": 7 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 5 - }, - "end": { - "line": 44, - "column": 7 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 45, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 45, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 45, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-declare.ts b/es2panda/test/parser/ts/test-keyword-declare.ts deleted file mode 100644 index e42283e57cd3fe504534cd36b28be5d761c02269..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var var1; -declare var var2; - -let var3; -declare let var4; - -const var5 = 1; -declare const var6 = 4; -declare const var7; - -type type1 = number | string; -declare type type2 = number | string; - -function func1() { }; -declare function func2(); -func2(); - -declare class Class1 { - private static get a() - public g() - static declare readonly [5] - static declare readonly ["b"] - static readonly declare 67 - declare static readonly j - private; - protected [1]() - public static k - #o; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare1-expected.txt b/es2panda/test/parser/ts/test-keyword-declare1-expected.txt deleted file mode 100644 index cfdb0d2b674a3fa898dc213e4687955387264bcf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Initializers are not allowed in ambient contexts. [test-keyword-declare1.ts:17:17] diff --git a/es2panda/test/parser/ts/test-keyword-declare1.ts b/es2panda/test/parser/ts/test-keyword-declare1.ts deleted file mode 100644 index 11d8dce914debc71e63bf228b05d537644d855ef..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare var a = 5; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare10-expected.txt b/es2panda/test/parser/ts/test-keyword-declare10-expected.txt deleted file mode 100644 index 7fffe814b0450b62ded4df640025f2d40b089442..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Generators are not allowed in an ambient context. [test-keyword-declare10.ts:18:14] diff --git a/es2panda/test/parser/ts/test-keyword-declare10.ts b/es2panda/test/parser/ts/test-keyword-declare10.ts deleted file mode 100644 index 7e147ac870bec436452de4799743dfb1bc26e457..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare10.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Foo { - public *g() -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare11-expected.txt b/es2panda/test/parser/ts/test-keyword-declare11-expected.txt deleted file mode 100644 index 4a985e6d7fafd34250fdc354810048c55bfd2bac..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare11-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An implementation cannot be declared in ambient contexts. [test-keyword-declare11.ts:18:16] diff --git a/es2panda/test/parser/ts/test-keyword-declare11.ts b/es2panda/test/parser/ts/test-keyword-declare11.ts deleted file mode 100644 index 30ba7d50614f4c75b0b407558711ce8cd3e325d5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare11.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Foo { - public g() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare12-expected.txt b/es2panda/test/parser/ts/test-keyword-declare12-expected.txt deleted file mode 100644 index 58ce56ba582b722b9aa3e9c0bc189e4282043563..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare12-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Initializers are not allowed in ambient contexts. [test-keyword-declare12.ts:18:24] diff --git a/es2panda/test/parser/ts/test-keyword-declare12.ts b/es2panda/test/parser/ts/test-keyword-declare12.ts deleted file mode 100644 index 18e1fcb088d0d29b58ed5905c40a7ad41d7664a9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare12.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Foo { - private static a = 3; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare13-expected.txt b/es2panda/test/parser/ts/test-keyword-declare13-expected.txt deleted file mode 100644 index e35b271086582867188d37abcc11f6a20526ee81..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare13-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Initializers are not allowed in ambient contexts. [test-keyword-declare13.ts:18:32] diff --git a/es2panda/test/parser/ts/test-keyword-declare13.ts b/es2panda/test/parser/ts/test-keyword-declare13.ts deleted file mode 100644 index d3b1056681764bcc476e7099b9b06e133e1cfde2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare13.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - private static declare a = 3; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare2-expected.txt b/es2panda/test/parser/ts/test-keyword-declare2-expected.txt deleted file mode 100644 index 528c41316e2f81e635ae49a9818b71efcfdc00a3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Initializers are not allowed in ambient contexts. [test-keyword-declare2.ts:17:17] diff --git a/es2panda/test/parser/ts/test-keyword-declare2.ts b/es2panda/test/parser/ts/test-keyword-declare2.ts deleted file mode 100644 index f70a9e05651f4145bc88f82695d9dce6a01af881..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare let a = 5; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare3-expected.txt b/es2panda/test/parser/ts/test-keyword-declare3-expected.txt deleted file mode 100644 index bda78d2974cb8c9dc7d853eda27505c8e6c79dd8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-keyword-declare3.ts:17:9] diff --git a/es2panda/test/parser/ts/test-keyword-declare3.ts b/es2panda/test/parser/ts/test-keyword-declare3.ts deleted file mode 100644 index d3c876d82a28346da1985d2339a5cbcf4b46ec46..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare a = 5; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare4-expected.txt b/es2panda/test/parser/ts/test-keyword-declare4-expected.txt deleted file mode 100644 index b18f1ce556aba6a48a1a1ff1399e71931a494ce2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An implementation cannot be declared in ambient contexts. [test-keyword-declare4.ts:17:22] diff --git a/es2panda/test/parser/ts/test-keyword-declare4.ts b/es2panda/test/parser/ts/test-keyword-declare4.ts deleted file mode 100644 index 5c726c99823a6c3c53ff9ea2f065bf0723549014..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare function a() { }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare5-expected.txt b/es2panda/test/parser/ts/test-keyword-declare5-expected.txt deleted file mode 100644 index 1a2f364ca97425a11598ddeff793c20175537868..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare5-expected.txt +++ /dev/null @@ -1,104 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 22 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-declare5.ts b/es2panda/test/parser/ts/test-keyword-declare5.ts deleted file mode 100644 index 0026a71fc265b874de52f11fc89746673bcd5d7b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare5.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function a(); -declare function a(); \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare6-expected.txt b/es2panda/test/parser/ts/test-keyword-declare6-expected.txt deleted file mode 100644 index 7493b19f77fbfd61f1c3397449920ecbad968e3c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare6-expected.txt +++ /dev/null @@ -1,131 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 18 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-declare6.ts b/es2panda/test/parser/ts/test-keyword-declare6.ts deleted file mode 100644 index f2fb4f6ea6b8b10f1a70a36d221b98ea4ead9447..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare6.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare function a(); -function a() { }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare7-expected.txt b/es2panda/test/parser/ts/test-keyword-declare7-expected.txt deleted file mode 100644 index f4f9efa3b7815a899891c636a0e610d2e2679a6e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare7-expected.txt +++ /dev/null @@ -1,188 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 18 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-declare7.ts b/es2panda/test/parser/ts/test-keyword-declare7.ts deleted file mode 100644 index 732c16c18ca06481912322ba42a5deeb7faf13fb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare function a(); -var b = 5; -function a() { }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare8-expected.txt b/es2panda/test/parser/ts/test-keyword-declare8-expected.txt deleted file mode 100644 index 75a07c73c27ec385c35ba8b8228e6453dff67615..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An implementation cannot be declared in ambient contexts. [test-keyword-declare8.ts:18:28] diff --git a/es2panda/test/parser/ts/test-keyword-declare8.ts b/es2panda/test/parser/ts/test-keyword-declare8.ts deleted file mode 100644 index 66435c36aa38eb8859dc32e86a553dfe90959435..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare8.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Foo { - private static get a() { return } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-declare9-expected.txt b/es2panda/test/parser/ts/test-keyword-declare9-expected.txt deleted file mode 100644 index 53d4a528bd6d3a504969df2e7fadd2f498cca194..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'async' modifier cannot be used in an ambient context. [test-keyword-declare9.ts:18:19] diff --git a/es2panda/test/parser/ts/test-keyword-declare9.ts b/es2panda/test/parser/ts/test-keyword-declare9.ts deleted file mode 100644 index 4f885b6c3b6228a4b150c6cdde0e57a787b7ef18..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-declare9.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class Foo { - public async g() -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-identify1-expected.txt b/es2panda/test/parser/ts/test-keyword-identify1-expected.txt deleted file mode 100644 index ced9c424df48a5b1d409c114304d3ad45f9aae8e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify1-expected.txt +++ /dev/null @@ -1,321 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 3 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "N", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 15 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 15 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify1.ts b/es2panda/test/parser/ts/test-keyword-identify1.ts deleted file mode 100644 index 9c48819f23a24a25397b6f56888716ddbc7c9063..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var namespace = 1, ns = 2; -namespace = 2; -namespace++; - -namespace -ns -{} - -namespace N {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-identify2-expected.txt b/es2panda/test/parser/ts/test-keyword-identify2-expected.txt deleted file mode 100644 index 01220207c7b3081b9aaaa0f85c1be09ad09ed35e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify2-expected.txt +++ /dev/null @@ -1,389 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 39 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 3 - } - } - }, - { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 3 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 26, - "column": 27 - }, - "end": { - "line": 26, - "column": 29 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 26, - "column": 29 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify2.ts b/es2panda/test/parser/ts/test-keyword-identify2.ts deleted file mode 100644 index a2c2b9b4f7fe6ff1c10b3941f78ffb45227e8352..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify2.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var declare = 0, namespace = 1, ns = 2; -declare = 2; -declare++; - -declare -namespace -ns -{} - -declare namespace declare {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-identify3-expected.txt b/es2panda/test/parser/ts/test-keyword-identify3-expected.txt deleted file mode 100644 index 055d0bd765a09991059f18639e7de9e5dcbb355b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify3-expected.txt +++ /dev/null @@ -1,373 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "abstract", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 17 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "abstract", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "abstract", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "abstract", - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "abstract": true, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 3 - }, - "end": { - "line": 23, - "column": 13 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify3.ts b/es2panda/test/parser/ts/test-keyword-identify3.ts deleted file mode 100644 index f2466db2d84d2bd946df102e82ea3c1bdde44059..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify3.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var abstract = 1; -abstract = 2; -abstract++; - -abstract class C { - abstract = 1; - abstract a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-identify4-expected.txt b/es2panda/test/parser/ts/test-keyword-identify4-expected.txt deleted file mode 100644 index 39fba4a89732283341ebda834a30af05bf966a0f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify4-expected.txt +++ /dev/null @@ -1,322 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - "declare": true, - "global": true, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 7 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify4.ts b/es2panda/test/parser/ts/test-keyword-identify4.ts deleted file mode 100644 index f72625740c72b347914ae529bdb49dd2b00e3f29..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify4.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export var declare = 0, global = 1; -global = 2; -global++; - -declare global {} - -declare -global diff --git a/es2panda/test/parser/ts/test-keyword-identify5-expected.txt b/es2panda/test/parser/ts/test-keyword-identify5-expected.txt deleted file mode 100644 index d6cc459d4b3529c5b4d5cfc7d033ec322a773c41..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify5-expected.txt +++ /dev/null @@ -1,500 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 36 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 3 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 7 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 3 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "M", - "loc": { - "start": { - "line": 30, - "column": 8 - }, - "end": { - "line": 30, - "column": 9 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 12 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 32, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "StringLiteral", - "value": "module", - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 32, - "column": 25 - }, - "end": { - "line": 32, - "column": 27 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 33, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 33, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify5.ts b/es2panda/test/parser/ts/test-keyword-identify5.ts deleted file mode 100644 index 4d704df9afc671cf819712c33944ad8d5b41db5e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify5.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var declare = 0, module = 1, ns = 2; -module = 2; -module++; - -module -ns -{} - -declare -module -"a" -{} - -module M {} - -declare module "module" {} diff --git a/es2panda/test/parser/ts/test-keyword-identify6-expected.txt b/es2panda/test/parser/ts/test-keyword-identify6-expected.txt deleted file mode 100644 index 35147d0c279e5b56a7714b31ed03971592b00e85..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify6-expected.txt +++ /dev/null @@ -1,304 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 5 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 5 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify6.ts b/es2panda/test/parser/ts/test-keyword-identify6.ts deleted file mode 100644 index bd0a7d000150a72f947c67681b27bf28e4d57de5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify6.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var type = 1, a = 0; -type = 2; -type++; - -type a = number; - -type -a diff --git a/es2panda/test/parser/ts/test-keyword-identify7-expected.txt b/es2panda/test/parser/ts/test-keyword-identify7-expected.txt deleted file mode 100644 index e362bb5771b1373c2c4098094e98d46c59d0d0c4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify7-expected.txt +++ /dev/null @@ -1,227 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 14 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "generator": false, - "async": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 21 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify7.ts b/es2panda/test/parser/ts/test-keyword-identify7.ts deleted file mode 100644 index 40d4f2549ca53f3cf97f4227b9b115281022831a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify7.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var async = 1; -async = 2; -async++; - -async function f(){} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-identify8-expected.txt b/es2panda/test/parser/ts/test-keyword-identify8-expected.txt deleted file mode 100644 index 7f090e1e88771b93bb2a20da22005ca8bcaf1556..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify8-expected.txt +++ /dev/null @@ -1,312 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "g", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify8.ts b/es2panda/test/parser/ts/test-keyword-identify8.ts deleted file mode 100644 index 9acc3fb0254781d9975585a4988bc0485ec34ea4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify8.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function f() { - let global = 1; -} - -function g() { - class global {} -} diff --git a/es2panda/test/parser/ts/test-keyword-identify9-expected.txt b/es2panda/test/parser/ts/test-keyword-identify9-expected.txt deleted file mode 100644 index 71f2d72ee635c25a9f2737206d81c57c94072f73..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify9-expected.txt +++ /dev/null @@ -1,915 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 15 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 20 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 14 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 18 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 7 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 27, - "column": 15 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 14 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 31, - "column": 10 - }, - "end": { - "line": 31, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 21 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "assertsUse", - "loc": { - "start": { - "line": 33, - "column": 10 - }, - "end": { - "line": 33, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 33 - }, - "end": { - "line": 33, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 33 - }, - "end": { - "line": 33, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 24 - }, - "end": { - "line": 33, - "column": 31 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 33, - "column": 45 - }, - "end": { - "line": 33, - "column": 52 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "NonNullable", - "loc": { - "start": { - "line": 33, - "column": 56 - }, - "end": { - "line": 33, - "column": 67 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 68 - }, - "end": { - "line": 33, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 68 - }, - "end": { - "line": 33, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 67 - }, - "end": { - "line": 33, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 56 - }, - "end": { - "line": 33, - "column": 67 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 33, - "column": 37 - }, - "end": { - "line": 33, - "column": 67 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 20 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 33, - "column": 71 - }, - "end": { - "line": 33, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 34, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-identify9.ts b/es2panda/test/parser/ts/test-keyword-identify9.ts deleted file mode 100644 index 5dbe13a7ab95401a452008162c0459533246c097..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-identify9.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class is { } - -namespace is { - var is = 1; - var asserts = 2; - var async = 3; -} - -class asserts { - is = 1; - asserts = 2; - async = 3; -} - -function async() { } - -function assertsUse(asserts: T): asserts asserts is NonNullable { } diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out1-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out1-expected.txt deleted file mode 100644 index c1b823d10c15ac118e381240ace5b3d28d934aeb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out1-expected.txt +++ /dev/null @@ -1,127 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Provider", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "in": false, - "out": true, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 32 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out1.ts b/es2panda/test/parser/ts/test-keyword-in-and-out1.ts deleted file mode 100644 index 3a0f1ccb07d77e396437c64da0443c54ec5d691c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Provider = () => T; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out10-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out10-expected.txt deleted file mode 100644 index f2d0dff1ea80f514d2f183ca2de2b02f13a5ed59..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out10-expected.txt +++ /dev/null @@ -1,181 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "GenericNumber", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "in": false, - "out": true, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out10.ts b/es2panda/test/parser/ts/test-keyword-in-and-out10.ts deleted file mode 100644 index f186e1637558980670ec1f70250cbea0e963e64f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out10.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class GenericNumber { -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out11-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out11-expected.txt deleted file mode 100644 index 97e2c85791225f278f4de5f0bb8c1abc065052c9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out11-expected.txt +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "GenericNumber", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "extends": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "in": false, - "out": true, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out11.ts b/es2panda/test/parser/ts/test-keyword-in-and-out11.ts deleted file mode 100644 index 9ac0dbfb9cb00357287b7342c8c0db9386f00e5a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out11.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface GenericNumber { -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out12-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out12-expected.txt deleted file mode 100644 index b0c9c4fe623ac5b8c28f59e250661f73fcb049bb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out12-expected.txt +++ /dev/null @@ -1,117 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 15 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 11 - }, - "end": { - "line": 16, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 16, - "column": 21 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out12.ts b/es2panda/test/parser/ts/test-keyword-in-and-out12.ts deleted file mode 100644 index b83effb2a9a09a6256500a0104468add0e565cca..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out12.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function A() {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out13-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out13-expected.txt deleted file mode 100644 index 852d6218e59837fd4ef9b3022d583502031425d1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out13-expected.txt +++ /dev/null @@ -1,327 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "getProperty", - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "obj", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 55 - }, - "end": { - "line": 16, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 55 - }, - "end": { - "line": 16, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 50 - }, - "end": { - "line": 16, - "column": 53 - } - } - }, - { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Key", - "loc": { - "start": { - "line": 16, - "column": 65 - }, - "end": { - "line": 16, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 65 - }, - "end": { - "line": 16, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 60 - }, - "end": { - "line": 16, - "column": 63 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Key", - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 45 - }, - "end": { - "line": 16, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 45 - }, - "end": { - "line": 16, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 39 - }, - "end": { - "line": 16, - "column": 48 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 49 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "obj", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "property": { - "type": "Identifier", - "name": "key", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 70 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out13.ts b/es2panda/test/parser/ts/test-keyword-in-and-out13.ts deleted file mode 100644 index a47d2613d14c6118a7bfbdc0c918453a704e6f52..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out13.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function getProperty(obj: out, key: Key) { - return obj[key]; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out14-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out14-expected.txt deleted file mode 100644 index c7cec9ceaf6ccce156448c96be063036fc9a3957..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out14-expected.txt +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 16, - "column": 11 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - "extends": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - "in": true, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 16, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 16, - "column": 23 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out14.ts b/es2panda/test/parser/ts/test-keyword-in-and-out14.ts deleted file mode 100644 index 3862afc7860ad14670fb076e6b8c2e026c1fe534..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out14.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -interface I {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out15-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out15-expected.txt deleted file mode 100644 index 5ad54664fd75bd7eedd1559f4a3ae49988020cf2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out15-expected.txt +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 16, - "column": 11 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - "extends": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 20 - } - } - }, - "in": false, - "out": true, - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 16, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 16, - "column": 24 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out15.ts b/es2panda/test/parser/ts/test-keyword-in-and-out15.ts deleted file mode 100644 index eefdba667ab6a6f7237ff508b597a84b72690593..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out15.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -interface I {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out16-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out16-expected.txt deleted file mode 100644 index 4a9d2eff8b5b413d99054d6caadc6b55d8065f71..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out16-expected.txt +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 16, - "column": 25 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 16, - "column": 11 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - "extends": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "out", - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "in": true, - "out": true, - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 16, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 16, - "column": 27 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out16.ts b/es2panda/test/parser/ts/test-keyword-in-and-out16.ts deleted file mode 100644 index 2625608cfb41282a938cb18050dbffe6f1f3f4f3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out16.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -interface I {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out2-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out2-expected.txt deleted file mode 100644 index 68d1e9db99b77eedf0cf70b9dd7958654fe1f240..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out2-expected.txt +++ /dev/null @@ -1,155 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Consumer", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "in": true, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 38 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out2.ts b/es2panda/test/parser/ts/test-keyword-in-and-out2.ts deleted file mode 100644 index 491fda242edc7a10b22530ff462affe46c235148..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Consumer = (x: T) => void; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out3-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out3-expected.txt deleted file mode 100644 index 75f688e2fe5b249b38f71e6176ff88de6eb5f208..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out3-expected.txt +++ /dev/null @@ -1,198 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Mapper", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - } - ], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "in": true, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "in": false, - "out": true, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 40 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out3.ts b/es2panda/test/parser/ts/test-keyword-in-and-out3.ts deleted file mode 100644 index 52d8dab7d423ee4064925666d9164f0566dbbc5c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Mapper = (x: T) => U; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out4-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out4-expected.txt deleted file mode 100644 index 722ba901f0a1f951bb39ea0c3ffca9e239d516c6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out4-expected.txt +++ /dev/null @@ -1,169 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Processor", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - } - ], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "in": true, - "out": true, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 40 - } - } -} diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out4.ts b/es2panda/test/parser/ts/test-keyword-in-and-out4.ts deleted file mode 100644 index e6d520c2e69c9fb1290d5d72d717fbcac3ca4cba..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Processor = (x: T) => T; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out5-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out5-expected.txt deleted file mode 100644 index d3b3838ef2fac4e1d02894b647d534b7aa11a93d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'in' modifier must precede 'out' modifier. [test-keyword-in-and-out5.ts:17:17] diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out5.ts b/es2panda/test/parser/ts/test-keyword-in-and-out5.ts deleted file mode 100644 index e3037c575373137f4f3718272f155216a60d79c7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Getter = () => T; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out6-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out6-expected.txt deleted file mode 100644 index 5cbd15ff5dc213c482704e138532d16a7ac264a6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'out' modifier already seen. [test-keyword-in-and-out6.ts:17:20] diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out6.ts b/es2panda/test/parser/ts/test-keyword-in-and-out6.ts deleted file mode 100644 index 2fa91d3f22d103149a1f5edb999a39e8121e6528..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Getter = () => T; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out7-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out7-expected.txt deleted file mode 100644 index 69ec7e17114887b54ebe8047b4782f9bc4a0ae03..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'in' modifier already seen. [test-keyword-in-and-out7.ts:17:17] diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out7.ts b/es2panda/test/parser/ts/test-keyword-in-and-out7.ts deleted file mode 100644 index 72f8b913f997f4124234afb350f381d0b4961135..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Getter3 = () => T; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out8-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out8-expected.txt deleted file mode 100644 index ee3ea92d4c204ed4d7a66079d40eda30c57c85ae..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'out' modifier can only appear on a type parameter of a class, interface or type alias [test-keyword-in-and-out8.ts:17:13] diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out8.ts b/es2panda/test/parser/ts/test-keyword-in-and-out8.ts deleted file mode 100644 index d1fab9c3754e5157299fb47925fc744d12a45c75..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out8.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const foo: (x: T) => T = x => x; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out9-expected.txt b/es2panda/test/parser/ts/test-keyword-in-and-out9-expected.txt deleted file mode 100644 index 3b0fd364282f8f95dd99b49d4d69973f237e9106..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'in' modifier can only appear on a type parameter of a class, interface or type alias [test-keyword-in-and-out9.ts:17:19] diff --git a/es2panda/test/parser/ts/test-keyword-in-and-out9.ts b/es2panda/test/parser/ts/test-keyword-in-and-out9.ts deleted file mode 100644 index b888191da16e9ae84deec4c82fa3e1edfafd6d2b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-keyword-in-and-out9.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function identity(arg: T): T { - return arg; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-labeled-statement-expected.txt b/es2panda/test/parser/ts/test-labeled-statement-expected.txt deleted file mode 100644 index e32ad563e598026f7a873c93f219ba4e9a30f231..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-labeled-statement-expected.txt +++ /dev/null @@ -1,183 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f14", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "generator": false, - "async": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "LabelledStatement", - "label": { - "type": "Identifier", - "name": "block", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "BreakStatement", - "label": { - "type": "Identifier", - "name": "block", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-labeled-statement.ts b/es2panda/test/parser/ts/test-labeled-statement.ts deleted file mode 100644 index 4425918596e1015b2899cb9a38fc735e176a8214..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-labeled-statement.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -async function f14() { - block: { - await 1; - break block; - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-lessThan-expression1-expected.txt b/es2panda/test/parser/ts/test-lessThan-expression1-expected.txt deleted file mode 100644 index 0ec43a4e3236cc72cb0087d18c1319306e0cffa9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-lessThan-expression1-expected.txt +++ /dev/null @@ -1,314 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "arr", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 22 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - { - "type": "IfStatement", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "right": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "arr", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "property": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "helloWorld", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 23 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-lessThan-expression1.ts b/es2panda/test/parser/ts/test-lessThan-expression1.ts deleted file mode 100644 index 610a0f18a5af412782defb64fdadb5a29cfbda87..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-lessThan-expression1.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const arr = [1,2,3,4]; - -if (0 < arr[1 + 2]) { - print("helloWorld"); -} diff --git a/es2panda/test/parser/ts/test-lessThan-expression2-expected.txt b/es2panda/test/parser/ts/test-lessThan-expression2-expected.txt deleted file mode 100644 index 4ecc06eb25511d44b9b0a9f310bcd4903c1ea6ec..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-lessThan-expression2-expected.txt +++ /dev/null @@ -1,271 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "value": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Date", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "property": { - "type": "Identifier", - "name": "getTime", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 35 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-lessThan-expression2.ts b/es2panda/test/parser/ts/test-lessThan-expression2.ts deleted file mode 100644 index d5f203287e84d92b1db2f29006e204dbcb638521..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-lessThan-expression2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - a = 1 < (new Date().getTime()); -} diff --git a/es2panda/test/parser/ts/test-lessThan-expression3-expected.txt b/es2panda/test/parser/ts/test-lessThan-expression3-expected.txt deleted file mode 100644 index 4808ad75e77a64bd391a85901ec9d9727cfa495d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-lessThan-expression3-expected.txt +++ /dev/null @@ -1,215 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "result", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "init": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "property": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "right": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "property": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "property": { - "type": "BinaryExpression", - "operator": ">>", - "left": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 33 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-lessThan-expression3.ts b/es2panda/test/parser/ts/test-lessThan-expression3.ts deleted file mode 100644 index 1c4088d28ea3fe29995479937ab22ba58a484e50..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-lessThan-expression3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let result = x[1] < x[y[2 >> 1]]; diff --git a/es2panda/test/parser/ts/test-member-expression1-expected.txt b/es2panda/test/parser/ts/test-member-expression1-expected.txt deleted file mode 100644 index 16bddefa1101c77812875dc2d41bbfbd16fdcd84..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-member-expression1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Invalid left-hand side in assignment expression [test-member-expression1.ts:18:18] diff --git a/es2panda/test/parser/ts/test-member-expression1.ts b/es2panda/test/parser/ts/test-member-expression1.ts deleted file mode 100644 index 9363c4cfad99dfb7a8eacee7799c629fb01d5586..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-member-expression1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = {foo : {bar : {baz : 5}}}; -a?.foo?.bar?.baz = a?.foo?.bar?.baz; diff --git a/es2panda/test/parser/ts/test-member-expression2-expected.txt b/es2panda/test/parser/ts/test-member-expression2-expected.txt deleted file mode 100644 index e166cdd966871ef786f6b64bf77fbea81229bd6f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-member-expression2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Invalid left-hand side in assignment expression [test-member-expression2.ts:18:8] diff --git a/es2panda/test/parser/ts/test-member-expression2.ts b/es2panda/test/parser/ts/test-member-expression2.ts deleted file mode 100644 index bf7f7667c2c70150922ab359eb7bb31b36a952d5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-member-expression2.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = [0, 1, 2, 3, 4]; -a?.[0] = a?.[0]; diff --git a/es2panda/test/parser/ts/test-new-expression1-expected.txt b/es2panda/test/parser/ts/test-new-expression1-expected.txt deleted file mode 100644 index 83a8403d0ba67bf8b2527b1cb1b9b4a733d2d38d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-new-expression1-expected.txt +++ /dev/null @@ -1,335 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 8 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 8 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 36 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-new-expression1.ts b/es2panda/test/parser/ts/test-new-expression1.ts deleted file mode 100644 index 00470d96ef00ca7e9dc4dcbfdb9eba51666993b8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-new-expression1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -class A { -} - -let a : A = new A(); - diff --git a/es2panda/test/parser/ts/test-new-expression2-expected.txt b/es2panda/test/parser/ts/test-new-expression2-expected.txt deleted file mode 100644 index 0d25b52a6b311938b7066e27b50b6de30528c8d1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-new-expression2-expected.txt +++ /dev/null @@ -1,281 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "./typescript", - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "specifiers": [ - { - "type": "ImportDefaultSpecifier", - "local": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 16, - "column": 8 - }, - "end": { - "line": 16, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 8 - }, - "end": { - "line": 16, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "right": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "property": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 42 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-new-expression2.ts b/es2panda/test/parser/ts/test-new-expression2.ts deleted file mode 100644 index 5f21fe4cd798aeec2e48834b3b934e1596bae4bf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-new-expression2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import ns from "./typescript" - -let a : ns.A = new ns.A(); - diff --git a/es2panda/test/parser/ts/test-new-expression3-expected.txt b/es2panda/test/parser/ts/test-new-expression3-expected.txt deleted file mode 100644 index 47d3b736e9ade86c888f807467cc6e1322618fdd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-new-expression3-expected.txt +++ /dev/null @@ -1,453 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 8 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "returnType": { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "returnType": { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 19, - "column": 40 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 45 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-new-expression3.ts b/es2panda/test/parser/ts/test-new-expression3.ts deleted file mode 100644 index 8f3c2d5bfe382e4275b404ca28f56f0d4da5b46e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-new-expression3.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -class A { -} - -var a: A<() => {}> = new A<() => {}>() - diff --git a/es2panda/test/parser/ts/test-non-null-assertion-expected.txt b/es2panda/test/parser/ts/test-non-null-assertion-expected.txt deleted file mode 100644 index d3c89185374a765b3def1014088cf14be035cad4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-non-null-assertion-expected.txt +++ /dev/null @@ -1,226 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 17 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "IfStatement", - "test": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "TSNonNullExpression", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-non-null-assertion.ts b/es2panda/test/parser/ts/test-non-null-assertion.ts deleted file mode 100644 index d033ff522aabd5f9bbf65755ffeac0bc3b128b8f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-non-null-assertion.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let a:number = 1 -if (a ! = 2) { - print("hello") -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-object-expression-expected.txt b/es2panda/test/parser/ts/test-object-expression-expected.txt deleted file mode 100644 index a028b15217a287bd9476b5cbe3a8ea23d173d98c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-object-expression-expected.txt +++ /dev/null @@ -1,361 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 4 - } - } - }, - "value": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 4 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 4 - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 9 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 4 - } - } - } - ], - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 15 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-object-expression.ts b/es2panda/test/parser/ts/test-object-expression.ts deleted file mode 100644 index 9649a8860814cc94c80d0213746b86d2e5c86b00..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-object-expression.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I { a: number } - -({a}: I) => {} -([b]:number[]) => {} diff --git a/es2panda/test/parser/ts/test-object-expression2-expected.txt b/es2panda/test/parser/ts/test-object-expression2-expected.txt deleted file mode 100644 index e9787b480ed65c5b951a2a3ff94669de74f8991b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-object-expression2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '=>' expected. [test-object-expression2.ts:20:1] diff --git a/es2panda/test/parser/ts/test-object-expression2.ts b/es2panda/test/parser/ts/test-object-expression2.ts deleted file mode 100644 index 3a918c9a9059a934d3bc65fd87aa0501bfbd068b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-object-expression2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I { a: number } - -({a}:I) diff --git a/es2panda/test/parser/ts/test-private-identifier-expected.txt b/es2panda/test/parser/ts/test-private-identifier-expected.txt deleted file mode 100644 index e95a795f5b9585227ecb3c406535a5a5102e39be..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-private-identifier-expected.txt +++ /dev/null @@ -1,281 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "static": false, - "readonly": true, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "c", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "c", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "static": false, - "readonly": true, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 22 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-private-identifier.ts b/es2panda/test/parser/ts/test-private-identifier.ts deleted file mode 100644 index db2f85b9a4acefb65df34223486005a6d1d4ecd8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-private-identifier.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - #b = 'b'; - readonly a = 'a'; - readonly #c = 'c'; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class1-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class1-expected.txt deleted file mode 100644 index ca4be21568a79e01d9e56c6c795882c0e9c135b1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class1-expected.txt +++ /dev/null @@ -1,528 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "someCondition", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "num", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 46 - }, - "end": { - "line": 17, - "column": 53 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "count", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - { - "type": "ClassStaticBlock", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "IfStatement", - "test": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "someCondition", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 24 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "count", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "alternate": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "count", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 27, - "column": 4 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class1.ts b/es2panda/test/parser/ts/test-static-blocks-in-class1.ts deleted file mode 100644 index 0f315b716e38df8133044460d54499bef178ac73..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class1.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare function someCondition(num: number): boolean; - -class Foo { - static count = 0; - static { - if (someCondition(5)) { - Foo.count++; - } else { - Foo.count--; - } - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class2-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class2-expected.txt deleted file mode 100644 index 54fec5ec151f8e29f9d8f9e326af4cdc72edd160..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class2-expected.txt +++ /dev/null @@ -1,701 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "addResult", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "PrivateFoo", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "count", - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "kind": "get", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "PrivateFoo", - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 22 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "count", - "loc": { - "start": { - "line": 24, - "column": 7 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - "kind": "get", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "PrivateFoo", - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 25, - "column": 23 - }, - "end": { - "line": 25, - "column": 29 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 26, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 26, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 26, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 3 - }, - "end": { - "line": 26, - "column": 4 - } - } - }, - { - "type": "ClassStaticBlock", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "PrivateFoo", - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 17 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "addResult", - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 29, - "column": 37 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 29, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "handler": { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 31, - "column": 6 - } - } - }, - "param": null, - "loc": { - "start": { - "line": 30, - "column": 7 - }, - "end": { - "line": 31, - "column": 6 - } - } - }, - "finalizer": null, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 31, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 32, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 3 - }, - "end": { - "line": 32, - "column": 4 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 33, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 33, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class2.ts b/es2panda/test/parser/ts/test-static-blocks-in-class2.ts deleted file mode 100644 index de6098474bcf9f6e7c694ded8b73702d18e6d7b3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class2.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare function addResult(): number; - -class PrivateFoo { - static #count = 0; - static get count() { - return PrivateFoo.#count; - } - get count() { - return PrivateFoo.#count; - } - static { - try { - PrivateFoo.#count += addResult(); - } catch { - } - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class3-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class3-expected.txt deleted file mode 100644 index 6f48e701f6f55de92ed602af03289db8b67ffe8b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token '{' [test-static-blocks-in-class3.ts:19:3] diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class3.ts b/es2panda/test/parser/ts/test-static-blocks-in-class3.ts deleted file mode 100644 index b6c47f2a088a496194a105df9d844a0c305dcb37..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class3.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class ErrorFoo { - count = 0; - { // Expect error: Unexpected token. A constructor, method, accessor, or property was expected. - this.count++; - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class4-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class4-expected.txt deleted file mode 100644 index 79f7e9dc8d01756ff6c3d418a385d37effaa6e96..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class4-expected.txt +++ /dev/null @@ -1,669 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "MultiFoo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - { - "type": "ClassStaticBlock", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "StringLiteral", - "value": "hi ", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "right": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "MultiFoo", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "property": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 34 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - { - "type": "ClassStaticBlock", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "StringLiteral", - "value": "hello ", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, - "right": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "MultiFoo", - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 30 - } - } - }, - "property": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 23, - "column": 31 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 37 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - { - "type": "ClassStaticBlock", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "StringLiteral", - "value": "world ", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 19 - } - } - }, - "right": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "MultiFoo", - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 30 - } - } - }, - "property": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 26, - "column": 31 - }, - "end": { - "line": 26, - "column": 35 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 37 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 3 - }, - "end": { - "line": 27, - "column": 4 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class4.ts b/es2panda/test/parser/ts/test-static-blocks-in-class4.ts deleted file mode 100644 index 6691db6e10576cf16041689a162821a665393cf2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class4.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class MultiFoo { - static prop: number = 1; - static { - print("hi " + MultiFoo.prop++); - } - static { - print("hello " + MultiFoo.prop++); - } - static { - print("world " + MultiFoo.prop++); - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class5-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class5-expected.txt deleted file mode 100644 index eca2e2b8557f1527ebd69ebb4f206283a45497b0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class5-expected.txt +++ /dev/null @@ -1,595 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "ClassExpression", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "ClassStaticBlock", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "init": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 17 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 14 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "property": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 8 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 8 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 23, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 23, - "column": 4 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 10 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 26, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class5.ts b/es2panda/test/parser/ts/test-static-blocks-in-class5.ts deleted file mode 100644 index 915100b1b232a4040915a5f43362779848e41dcd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class5.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let a = class A { - static A = 1; - static { - let b: A = A; - print(b.A); - A.A = 2; - } -} -print(a.A) diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class6-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class6-expected.txt deleted file mode 100644 index 08ddb767918e6206f573468e67d4272caf862402..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token '{' [test-static-blocks-in-class6.ts:18:17] diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class6.ts b/es2panda/test/parser/ts/test-static-blocks-in-class6.ts deleted file mode 100644 index 850a7c2ee30bcb9ba16214b2e3b8006afcf3f2b3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class6.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C { - public static { - } -} diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class7-expected.txt b/es2panda/test/parser/ts/test-static-blocks-in-class7-expected.txt deleted file mode 100644 index 9072f1de75ced9035971217c49a7c930be7e5354..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test-static-blocks-in-class7.ts:19:3] diff --git a/es2panda/test/parser/ts/test-static-blocks-in-class7.ts b/es2panda/test/parser/ts/test-static-blocks-in-class7.ts deleted file mode 100644 index 2b87acc50ee6db73967a9ea0663eb8a06a285713..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-static-blocks-in-class7.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function bar(target, propertyKey){}; -class C { - @bar - static { - } -} diff --git a/es2panda/test/parser/ts/test-toplevel-await1-expected.txt b/es2panda/test/parser/ts/test-toplevel-await1-expected.txt deleted file mode 100644 index d0155802058659026a71e1028552e574e0b5a261..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await1-expected.txt +++ /dev/null @@ -1,439 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "foo1", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "await", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 24 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "foo2", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "foo3", - "loc": { - "start": { - "line": 27, - "column": 11 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 28, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 16 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 30, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 30, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-toplevel-await1.ts b/es2panda/test/parser/ts/test-toplevel-await1.ts deleted file mode 100644 index 9755a4fb9d58342bc48c32e9f6e2b6ddd00dc6be..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await1.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export {}; - -namespace foo1 { - const await: any =1; -} - -namespace foo2 { - class await {}; -} - -namespace foo3 { - function await() {}; -} diff --git a/es2panda/test/parser/ts/test-toplevel-await2-expected.txt b/es2panda/test/parser/ts/test-toplevel-await2-expected.txt deleted file mode 100644 index dea7a7778847fa1a0ff563971763243097a463a6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected reserved word [test-toplevel-await2.ts:19:10] diff --git a/es2panda/test/parser/ts/test-toplevel-await2.ts b/es2panda/test/parser/ts/test-toplevel-await2.ts deleted file mode 100644 index 93df48c3600392cee55a4c255ae654851f892e86..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export {}; - -function await() {} diff --git a/es2panda/test/parser/ts/test-toplevel-await3-expected.txt b/es2panda/test/parser/ts/test-toplevel-await3-expected.txt deleted file mode 100644 index 252e15642066562337b1bc25b344e43e2b792ec5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-toplevel-await3.ts:17:9] diff --git a/es2panda/test/parser/ts/test-toplevel-await3.ts b/es2panda/test/parser/ts/test-toplevel-await3.ts deleted file mode 100644 index 556450c43df55adc32fa94072c155dc3f138e29e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import {await} from "./other"; diff --git a/es2panda/test/parser/ts/test-toplevel-await4-expected.txt b/es2panda/test/parser/ts/test-toplevel-await4-expected.txt deleted file mode 100644 index b8c2c912d5afb3e188de63fbd7be15bdb729be31..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await4-expected.txt +++ /dev/null @@ -1,442 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "await", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "kind": "const", - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "implements": [ - { - "type": "TSClassImplements", - "expression": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 19, - "column": 42 - }, - "end": { - "line": 19, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 42 - }, - "end": { - "line": 19, - "column": 49 - } - } - } - ], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 19, - "column": 48 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 24, - "column": 7 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 17 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 26, - "column": 25 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 27, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-toplevel-await4.ts b/es2panda/test/parser/ts/test-toplevel-await4.ts deleted file mode 100644 index 80aaf539327471d036f8fca8e9e487f225e593b8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await4.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export { }; -declare const await: any; -declare class C extends await implements await { - await: number; -} - -namespace await { } -module await { } - -declare interface await { } diff --git a/es2panda/test/parser/ts/test-toplevel-await5-expected.txt b/es2panda/test/parser/ts/test-toplevel-await5-expected.txt deleted file mode 100644 index 39dd5fee55839dd10b625cdf18c66580ab444f23..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await5-expected.txt +++ /dev/null @@ -1,463 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "members": [ - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 14 - } - } - }, - "initializer": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 23, - "column": 6 - } - } - } - ], - "const": false, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns1", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 14 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "declare": true, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 29, - "column": 6 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 14 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 23 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 27, - "column": 25 - }, - "end": { - "line": 29, - "column": 6 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 29, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 30, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 32, - "column": 8 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "await", - "loc": { - "start": { - "line": 32, - "column": 14 - }, - "end": { - "line": 32, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 32, - "column": 22 - }, - "end": { - "line": 32, - "column": 28 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 33, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-toplevel-await5.ts b/es2panda/test/parser/ts/test-toplevel-await5.ts deleted file mode 100644 index 351d0a13bad278607732135c6033ea55d8746444..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-toplevel-await5.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export { }; -declare function await(); - -namespace ns { - enum await { - await = 1 - } -} - -namespace ns1 { - declare class await { - await(): void; - } -} - -declare type await = number; diff --git a/es2panda/test/parser/ts/test-ts-as-expression-expected.txt b/es2panda/test/parser/ts/test-ts-as-expression-expected.txt deleted file mode 100644 index 5790643124728e1d2755d885833afd48f2319ffb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-as-expression-expected.txt +++ /dev/null @@ -1,414 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "StringLiteral", - "value": "x", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "x", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "y", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "TSAsExpression", - "expression": { - "type": "TSAsExpression", - "expression": { - "type": "NullLiteral", - "value": null, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "typeAnnotation": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 18, - "column": 46 - }, - "end": { - "line": 18, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 52 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": { - "type": "TSAsExpression", - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "const", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-as-expression.ts b/es2panda/test/parser/ts/test-ts-as-expression.ts deleted file mode 100644 index 64d150e2bd10039b68ce58ca199daa6ab882f474..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-as-expression.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = "x" as "x" | "y"; -var b = null as any as string | undefined as never; -var c = 1 as const; diff --git a/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt deleted file mode 100644 index 35db236716306c69650a50406241709883c415a2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt +++ /dev/null @@ -1,1720 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "extendsType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 55 - }, - "end": { - "line": 18, - "column": 61 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 64 - }, - "end": { - "line": 18, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 73 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 84 - }, - "end": { - "line": 18, - "column": 91 - } - } - }, - "extendsType": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 102 - }, - "end": { - "line": 18, - "column": 108 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 100 - }, - "end": { - "line": 18, - "column": 108 - } - } - }, - "trueType": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 118 - }, - "end": { - "line": 18, - "column": 119 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 111 - }, - "end": { - "line": 18, - "column": 119 - } - } - }, - "falseType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 122 - }, - "end": { - "line": 18, - "column": 128 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 84 - }, - "end": { - "line": 18, - "column": 128 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 83 - }, - "end": { - "line": 18, - "column": 129 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 132 - }, - "end": { - "line": 18, - "column": 138 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 83 - }, - "end": { - "line": 18, - "column": 138 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 82 - }, - "end": { - "line": 18, - "column": 139 - } - } - }, - "trueType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 142 - }, - "end": { - "line": 18, - "column": 148 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 151 - }, - "end": { - "line": 18, - "column": 158 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 142 - }, - "end": { - "line": 18, - "column": 158 - } - } - }, - "extendsType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 167 - }, - "end": { - "line": 18, - "column": 173 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 176 - }, - "end": { - "line": 18, - "column": 182 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 185 - }, - "end": { - "line": 18, - "column": 191 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 142 - }, - "end": { - "line": 18, - "column": 191 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 194 - }, - "end": { - "line": 18, - "column": 200 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 200 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 201 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 37 - }, - "end": { - "line": 20, - "column": 43 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 46 - }, - "end": { - "line": 20, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 53 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - "extendsType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 36 - }, - "end": { - "line": 21, - "column": 42 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 45 - }, - "end": { - "line": 21, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 52 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 22 - }, - "end": { - "line": 22, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 28 - } - } - }, - "extendsType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 37 - }, - "end": { - "line": 22, - "column": 43 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 46 - }, - "end": { - "line": 22, - "column": 52 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 55 - }, - "end": { - "line": 22, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 62 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 27 - }, - "end": { - "line": 23, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 33 - } - } - }, - "extendsType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 42 - }, - "end": { - "line": 23, - "column": 48 - } - } - }, - "trueType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 51 - }, - "end": { - "line": 23, - "column": 57 - } - } - }, - "falseType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 60 - }, - "end": { - "line": 23, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 67 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Bar", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 32 - }, - "end": { - "line": 25, - "column": 33 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 32 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "trueType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 27, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 27, - "column": 8 - } - } - }, - "extendsType": { - "type": "TSFunctionType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 27, - "column": 27 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 27 - }, - "end": { - "line": 27, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 25 - } - } - } - ], - "returnType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 27, - "column": 43 - }, - "end": { - "line": 27, - "column": 44 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 43 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 37 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 17 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "trueType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 28, - "column": 7 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 7 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 8 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 29, - "column": 31 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 31 - }, - "end": { - "line": 29, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 25 - }, - "end": { - "line": 29, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 24 - }, - "end": { - "line": 29, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "trueType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 30, - "column": 7 - }, - "end": { - "line": 30, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 7 - }, - "end": { - "line": 30, - "column": 8 - } - } - }, - "falseType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 31, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 31, - "column": 9 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-conditional-type.ts b/es2panda/test/parser/ts/test-ts-conditional-type.ts deleted file mode 100644 index afeec0ad7fdf174e670d02244e1165b2a13c1096..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 5; -type A = (string | number & boolean extends boolean ? number : string)[] extends ((boolean extends & string ? typeof a : number) | number) ? number | boolean extends string ? number : string : string; - -var b: boolean & number extends A ? number : string; -var c: A | number extends string ? number : string; -var d: boolean | A & string extends string ? number : string; -var e: boolean & number | string extends string ? number : string; - -type Bar = T extends (infer U)[] - ? U - : T extends (...args: any[]) => infer U - ? U - : T extends Promise - ? U - : T; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type1-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type1-expected.txt deleted file mode 100644 index 2ca3cfb37585e07322e791943011d4b85f58c461..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '?' expected. [test-ts-conditional-type1.ts:17:34] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type1.ts b/es2panda/test/parser/ts/test-ts-conditional-type1.ts deleted file mode 100644 index 45adf005fea5a2daef30f6e9628fb7e170742bbd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = string extends number extends string ?number: string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type2-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type2-expected.txt deleted file mode 100644 index 166ebb75fb8bb86d03772104142d78ee2a6fdb5a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-ts-conditional-type2.ts:17:51] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type2.ts b/es2panda/test/parser/ts/test-ts-conditional-type2.ts deleted file mode 100644 index ce3c9812afc6a4e0155d2e534dcc4941ad16cae7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = string extends number ? number extends : string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type3-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type3-expected.txt deleted file mode 100644 index 73d46728b38ca041f827fdfe32bbe21b6db1f1a6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ':' expected. [test-ts-conditional-type3.ts:17:43] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type3.ts b/es2panda/test/parser/ts/test-ts-conditional-type3.ts deleted file mode 100644 index 6ec7f2aa299f7a622f09b1f0eddad5542aeaa83c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = string extends number ? number string : string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type4-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type4-expected.txt deleted file mode 100644 index 4c9caa24fafe0d1b23d1a540fed6d2429e32884a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-ts-conditional-type4.ts:17:59] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type4.ts b/es2panda/test/parser/ts/test-ts-conditional-type4.ts deleted file mode 100644 index 5fa65b4d13b99f91d8920d50755b4e83d4dbfc8f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = string extends number ? number : string extends; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type5-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type5-expected.txt deleted file mode 100644 index e5d7e4e808eb947deec1c81dfcfdd8bf3a162cf1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. [test-ts-conditional-type5.ts:17:12] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type5.ts b/es2panda/test/parser/ts/test-ts-conditional-type5.ts deleted file mode 100644 index fb455ddb182447e1b6f66da955266bc00435ff11..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = infer string extends number ? number : string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type6-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type6-expected.txt deleted file mode 100644 index 05368b61a28f1b2e4ffbda50ae99f6792a69774f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. [test-ts-conditional-type6.ts:17:36] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type6.ts b/es2panda/test/parser/ts/test-ts-conditional-type6.ts deleted file mode 100644 index 4b1a534e39589059590c25ae117a03f09e60b80d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = string extends number ? infer number : string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-conditional-type7-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type7-expected.txt deleted file mode 100644 index a98d40099c8c083e06c1c83248951164096f9498..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. [test-ts-conditional-type7.ts:17:45] diff --git a/es2panda/test/parser/ts/test-ts-conditional-type7.ts b/es2panda/test/parser/ts/test-ts-conditional-type7.ts deleted file mode 100644 index 3b2466bd8ea48dad0620dee731dd9423ae219f06..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-conditional-type7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = string extends number ? number : infer string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-constructor-type1-expected.txt b/es2panda/test/parser/ts/test-ts-constructor-type1-expected.txt deleted file mode 100644 index c88a2bba40a4eb37d730ed08cb067397a993f2d5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '=>' expected [test-ts-constructor-type1.ts:17:37] diff --git a/es2panda/test/parser/ts/test-ts-constructor-type1.ts b/es2panda/test/parser/ts/test-ts-constructor-type1.ts deleted file mode 100644 index 4d4e96673bc9140400653190e691a3cc162baa8b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var ctor: new (a: number, b: string); \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-constructor-type2-expected.txt b/es2panda/test/parser/ts/test-ts-constructor-type2-expected.txt deleted file mode 100644 index bdf31680118b0e659c6309762eb4282b642b96e1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '=>' expected [test-ts-constructor-type2.ts:17:46] diff --git a/es2panda/test/parser/ts/test-ts-constructor-type2.ts b/es2panda/test/parser/ts/test-ts-constructor-type2.ts deleted file mode 100644 index e6dcf24d0d1cfade38089f376e76744ced1b2f36..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var ctor: abstract new (a: number, b: string); \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-constructor-type3-expected.txt b/es2panda/test/parser/ts/test-ts-constructor-type3-expected.txt deleted file mode 100644 index f30fe6db311833584a1ac99025997fad394d2edd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '(' expected [test-ts-constructor-type3.ts:17:16] diff --git a/es2panda/test/parser/ts/test-ts-constructor-type3.ts b/es2panda/test/parser/ts/test-ts-constructor-type3.ts deleted file mode 100644 index 28c51cc0fe2ff4242d84f7bb7f806931035e1134..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var ctor1: new abstract (a: number, b: string) => number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-constructor-type4-expected.txt b/es2panda/test/parser/ts/test-ts-constructor-type4-expected.txt deleted file mode 100644 index aa4f952e9b4f368fee6599cb9d8fe6cddc1cb952..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-constructor-type4.ts:17:21] diff --git a/es2panda/test/parser/ts/test-ts-constructor-type4.ts b/es2panda/test/parser/ts/test-ts-constructor-type4.ts deleted file mode 100644 index d4df308c5723a771e881255400c69a0676c651c0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-constructor-type4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var ctor1: abstract (a: number, b: string) => number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-1-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-1-expected.txt deleted file mode 100644 index ed35e4786fe4c4a1e3586fb0e22b68cfdafc04c9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-1-expected.txt +++ /dev/null @@ -1,333 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "name", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 4 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Dict", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "dict", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Dict", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 23, - "column": 3 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 9 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 23, - "column": 3 - }, - "end": { - "line": 23, - "column": 9 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "c", - "loc": { - "start": { - "line": 24, - "column": 3 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 9 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 24, - "column": 3 - }, - "end": { - "line": 24, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 25, - "column": 2 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-index-signature-1.ts b/es2panda/test/parser/ts/test-ts-index-signature-1.ts deleted file mode 100644 index 699ea1007a901d81eb241d03a4f7bf5a0ab39af6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Dict { - [name: string]: number; -} - -const dict: Dict = { - "a": 1, - "b": 2, - "c": 3 -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-2-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-2-expected.txt deleted file mode 100644 index 59b923d34832db2ac73b035a51fa94e8116d6e77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ',' expected [test-ts-index-signature-2.ts:18:10] diff --git a/es2panda/test/parser/ts/test-ts-index-signature-2.ts b/es2panda/test/parser/ts/test-ts-index-signature-2.ts deleted file mode 100644 index b7c8b95bbdb78b676627f08e6ecd5d8de949a08a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface DictError { - static [name: string]: number; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-3-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-3-expected.txt deleted file mode 100644 index 44ebdae89ab209825a18dd00640afa4b882f8dc6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-3-expected.txt +++ /dev/null @@ -1,278 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ages", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "name", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "A", - "loc": { - "start": { - "line": 17, - "column": 43 - }, - "end": { - "line": 17, - "column": 46 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 17, - "column": 48 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 17, - "column": 43 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "B", - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 57 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 57 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "C", - "loc": { - "start": { - "line": 17, - "column": 59 - }, - "end": { - "line": 17, - "column": 62 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 6, - "loc": { - "start": { - "line": 17, - "column": 64 - }, - "end": { - "line": 17, - "column": 65 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 17, - "column": 59 - }, - "end": { - "line": 17, - "column": 65 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 66 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 67 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 67 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-index-signature-3.ts b/es2panda/test/parser/ts/test-ts-index-signature-3.ts deleted file mode 100644 index 92e1934aad66ee272d3f354432a2c316a26ad831..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const ages: { [name: string]: number } = {"A": 4, "B": 5, "C": 6}; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-4-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-4-expected.txt deleted file mode 100644 index 3f87d381593eb58824f689a0a43b46b8010f88e2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ',' expected [test-ts-index-signature-4.ts:17:27] diff --git a/es2panda/test/parser/ts/test-ts-index-signature-4.ts b/es2panda/test/parser/ts/test-ts-index-signature-4.ts deleted file mode 100644 index 908198291bd7b9635b7cea3fd866306c46d3ce49..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const agesError: { static [name: string]: number } = {"A": 4, "B": 5, "C": 6}; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-5-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-5-expected.txt deleted file mode 100644 index 41f6079b70e41fed22daccbe3e6958c8670e30aa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-5-expected.txt +++ /dev/null @@ -1,801 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "str", - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 123, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "indexSignatures": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 4 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 32 - }, - "end": { - "line": 20, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 30 - }, - "end": { - "line": 21, - "column": 36 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 39 - }, - "end": { - "line": 21, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 30 - }, - "end": { - "line": 21, - "column": 45 - } - } - }, - "readonly": false, - "static": true, - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 21, - "column": 45 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 21 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "readonly": true, - "static": false, - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 30 - }, - "end": { - "line": 23, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 39 - }, - "end": { - "line": 23, - "column": 45 - } - } - }, - "readonly": true, - "static": true, - "loc": { - "start": { - "line": 23, - "column": 3 - }, - "end": { - "line": 23, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 4 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "whatever", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 456, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 8 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 23 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 27, - "column": 16 - }, - "end": { - "line": 27, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "word", - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 11 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 12 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "hi", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 28, - "column": 20 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-index-signature-5.ts b/es2panda/test/parser/ts/test-ts-index-signature-5.ts deleted file mode 100644 index aecdb11fd74f55b162d3452bbbe0315e8e23414a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-5.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - str: string = "hello"; - num: number = 123; - [propName: string]: string | number; - static [propName: string]: string | number; - readonly [propName: number]: string; - static readonly [propName: number]: string; -} - -Foo["whatever"] = 456; -let foo: Foo = new Foo(); -foo['word'] = "hi"; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-6-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-6-expected.txt deleted file mode 100644 index 9c3acbe120016c31dc6c3c39c7a59d18c8349caa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-ts-index-signature-6.ts:23:12] diff --git a/es2panda/test/parser/ts/test-ts-index-signature-6.ts b/es2panda/test/parser/ts/test-ts-index-signature-6.ts deleted file mode 100644 index 0f205c4120d7cf63434cfb73bde2979b0a33263e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-6.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class FooError { - str: string = "hello"; - num: number = 123; - [propName: string]: string | number; - static [propName: string]: string | number; - readonly [propName: number]: string; - readonly static [propName: number]: string; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-index-signature-expected-transform.txt b/es2panda/test/parser/ts/test-ts-index-signature-expected-transform.txt deleted file mode 100644 index 350a18ce454fe7cfc07543e8eeb7c89032a1ba57..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-expected-transform.txt +++ /dev/null @@ -1,1085 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "property": { - "type": "Identifier", - "name": "str", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "property": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 123, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "str", - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 24 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 24 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 123, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 20 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 20 - } - } - } - ], - "indexSignatures": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 29 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 7, - "column": 32 - }, - "end": { - "line": 7, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 38 - } - } - }, - "readonly": false, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 38 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 36 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 8, - "column": 39 - }, - "end": { - "line": 8, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 45 - } - } - }, - "readonly": false, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 4 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "whatever", - "loc": { - "start": { - "line": 12, - "column": 5 - }, - "end": { - "line": 12, - "column": 15 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 42, - "loc": { - "start": { - "line": 12, - "column": 19 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 22 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 6 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 12 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "whatever", - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 23 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 24 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 14, - "column": 1 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 15, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 15, - "column": 7 - }, - "end": { - "line": 15, - "column": 8 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 15, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 15, - "column": 10 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "word", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "hi", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "word", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 15 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-index-signature-expected.txt b/es2panda/test/parser/ts/test-ts-index-signature-expected.txt deleted file mode 100644 index 513b1497684b7a22d82becff7a87ce146eafa9d7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-index-signature-expected.txt +++ /dev/null @@ -1,918 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "str", - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 24 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 24 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 123, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 20 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 20 - } - } - } - ], - "indexSignatures": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 29 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 7, - "column": 32 - }, - "end": { - "line": 7, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 38 - } - } - }, - "readonly": false, - "loc": { - "start": { - "line": 7, - "column": 3 - }, - "end": { - "line": 7, - "column": 38 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "propName", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 36 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 8, - "column": 39 - }, - "end": { - "line": 8, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 45 - } - } - }, - "readonly": false, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 4 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "whatever", - "loc": { - "start": { - "line": 12, - "column": 5 - }, - "end": { - "line": 12, - "column": 15 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 42, - "loc": { - "start": { - "line": 12, - "column": 19 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 22 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 6 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 12 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "whatever", - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 23 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 24 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 14, - "column": 1 - }, - "end": { - "line": 14, - "column": 25 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 15, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 15, - "column": 7 - }, - "end": { - "line": 15, - "column": 8 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 15, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 15, - "column": 10 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - "property": { - "type": "StringLiteral", - "value": "word", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "hi", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "word", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 15 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 16 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt b/es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt deleted file mode 100644 index 3e18ab04815f17298d070d5f01340c3dfb8f7c41..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-key-remapping-via-as-expected.txt +++ /dev/null @@ -1,884 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "GetName", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Type", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "nameKeyType": { - "type": "TSIndexedAccessType", - "objectType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "indexType": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "name", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Type", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "constraint": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "NameA", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "A", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "kind", - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 32 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 21, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "NameB", - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "B", - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "kind", - "loc": { - "start": { - "line": 21, - "column": 26 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 21, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 26 - }, - "end": { - "line": 21, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 22, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "NameC", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "C", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "kind", - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 23, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Name", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "GetName", - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "NameA", - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "NameB", - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "NameC", - "loc": { - "start": { - "line": 23, - "column": 37 - }, - "end": { - "line": 23, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 37 - }, - "end": { - "line": 23, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 43 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts b/es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts deleted file mode 100644 index 432297669cf58356b45c69b0ac3c83d46713e989..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-key-remapping-via-as.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type GetName = { - [p in Type as p["name"]] : number; -} -type NameA = {name: "A", kind: string} -type NameB = {name: "B", kind: string} -type NameC = {name: "C", kind: string} -type Name = GetName \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt deleted file mode 100644 index 119d9c355611bd67d6be0b4fb0863f091283ffe8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt +++ /dev/null @@ -1,1164 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type1", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 52 - }, - "end": { - "line": 17, - "column": 59 - } - } - }, - "readonly": "-", - "optional": "-", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 62 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type2", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 18, - "column": 52 - }, - "end": { - "line": 18, - "column": 59 - } - } - }, - "readonly": "+", - "optional": "+", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 62 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 63 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type3", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T3", - "loc": { - "start": { - "line": 19, - "column": 44 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 44 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "readonly": "+", - "optional": "+", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 60 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T3", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 61 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type4", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T4", - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 20, - "column": 40 - }, - "end": { - "line": 20, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 50 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T4", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 51 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type5", - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T5", - "loc": { - "start": { - "line": 21, - "column": 35 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 35 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 21, - "column": 40 - }, - "end": { - "line": 21, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 49 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T5", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 50 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type6", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T6", - "loc": { - "start": { - "line": 22, - "column": 35 - }, - "end": { - "line": 22, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 35 - }, - "end": { - "line": 22, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 29 - }, - "end": { - "line": 22, - "column": 37 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 41 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T6", - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 42 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Type7", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "prop", - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 25 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 23, - "column": 35 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 35 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 40 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 41 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-mapped-type.ts b/es2panda/test/parser/ts/test-ts-mapped-type.ts deleted file mode 100644 index 8fbb2ccb6b683f5491d3f98bdb09b0d0f6ee462c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Type1 = { -readonly [prop in keyof T1]-?: boolean; }; -type Type2 = { +readonly [prop in keyof T2]+?: boolean; }; -type Type3 = { readonly [prop in keyof T3]?: boolean; }; -type Type4 = { [prop in keyof T4]: boolean; }; -type Type5 = { [prop in keyof T5]: boolean }; -type Type6 = { [prop in keyof T6]; }; -type Type7 = { [prop in keyof T7] }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type1-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type1-expected.txt deleted file mode 100644 index 27d43edc6adbaf9f1e3268a4f85ee3d1a1aac471..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-mapped-type1.ts:17:17] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type1.ts b/es2panda/test/parser/ts/test-ts-mapped-type1.ts deleted file mode 100644 index e094346a7983e08e692905eb286fdd546ddf5bea..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { + s readonly[prop in keyof T] }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type2-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type2-expected.txt deleted file mode 100644 index fce6576fed97a576bde1653e339f43e3d1e932db..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-mapped-type2.ts:17:26] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type2.ts b/es2panda/test/parser/ts/test-ts-mapped-type2.ts deleted file mode 100644 index d348090e5e127f7850cbc0f426cfa29e70bc0e53..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { readonly + [prop in keyof T] }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type3-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type3-expected.txt deleted file mode 100644 index 61ce032e9418ed9964ade2f25c73fc7a9dc1e0da..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ']' expected [test-ts-mapped-type3.ts:17:32] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type3.ts b/es2panda/test/parser/ts/test-ts-mapped-type3.ts deleted file mode 100644 index 0431af218f31b55bf5c1d42cabc6635218e6b2fb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { readonly [prop keyof T] }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type4-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type4-expected.txt deleted file mode 100644 index dedff3acbcb3caa2239bcf9a0c62f2059525cd4d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ']' expected [test-ts-mapped-type4.ts:17:43] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type4.ts b/es2panda/test/parser/ts/test-ts-mapped-type4.ts deleted file mode 100644 index ad02fdbaa0929c36fcb294ec52c722df589e419a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { readonly [prop in keyof T +] }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type5-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type5-expected.txt deleted file mode 100644 index 4473243fdd307bd2fb6cfb4b7883afe890631088..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '?' expected. [test-ts-mapped-type5.ts:17:44] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type5.ts b/es2panda/test/parser/ts/test-ts-mapped-type5.ts deleted file mode 100644 index aa84e6fef45d38d9efe879f7767d08dee37f2007..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { readonly [prop in keyof T]+-? }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type6-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type6-expected.txt deleted file mode 100644 index 87acd416c9b0ef89f8db7a5fb8af02823e4c6365..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected [test-ts-mapped-type6.ts:17:43] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type6.ts b/es2panda/test/parser/ts/test-ts-mapped-type6.ts deleted file mode 100644 index 4ad902edb3818d0423e4f3e0096a4c0c574f8019..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { readonly [prop in keyof T]3 }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-mapped-type7-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type7-expected.txt deleted file mode 100644 index ead15f46faba12f4d20730ea63af7594c95fb3c6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '}' expected [test-ts-mapped-type7.ts:17:44] diff --git a/es2panda/test/parser/ts/test-ts-mapped-type7.ts b/es2panda/test/parser/ts/test-ts-mapped-type7.ts deleted file mode 100644 index 56da301c6fa54ac7426da607ff314f300b19f226..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-mapped-type7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Foo = { readonly [prop in keyof T];3 }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-non-null-expression-expected.txt b/es2panda/test/parser/ts/test-ts-non-null-expression-expected.txt deleted file mode 100644 index ef4f9a417dd0280fe68432605080dbad2d369daa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-non-null-expression-expected.txt +++ /dev/null @@ -1,401 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 18 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "TSNonNullExpression", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": false, - "argument": { - "type": "TSNonNullExpression", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "--", - "prefix": true, - "argument": { - "type": "TSNonNullExpression", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": true, - "argument": { - "type": "TSNonNullExpression", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 21, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "right": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "TSNonNullExpression", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - "right": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 12 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-non-null-expression.ts b/es2panda/test/parser/ts/test-ts-non-null-expression.ts deleted file mode 100644 index 6567bffc30c7176bd859399930b1c21c24be4583..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-non-null-expression.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: number = 1; -a!++; -a!--; ---a!; -++a!; -a = a! + a; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property-expected.txt deleted file mode 100644 index 6e169c21d84c088a9a6b0b25b4201a8e54a9fce8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property-expected.txt +++ /dev/null @@ -1,1300 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ExampleClass1", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "declare", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "async", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "async", - "loc": { - "start": { - "line": 20, - "column": 25 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "public", - "readonly": false, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "private", - "readonly": false, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "protected", - "readonly": false, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "undefined", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "public", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "private", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "protected", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "g", - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - { - "type": "TSParameterProperty", - "accessibility": "public", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "readonly", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 28, - "column": 35 - }, - "end": { - "line": 28, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 25 - }, - "end": { - "line": 28, - "column": 33 - } - } - }, - "right": { - "type": "BooleanLiteral", - "value": false, - "loc": { - "start": { - "line": 28, - "column": 45 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 25 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "h", - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 12 - } - } - }, - { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "i", - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 12 - } - } - }, - "value": { - "type": "Identifier", - "name": "i", - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 12 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 30, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 14 - } - } - }, - { - "type": "AssignmentPattern", - "left": { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "j", - "loc": { - "start": { - "line": 31, - "column": 10 - }, - "end": { - "line": 31, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 12 - } - } - }, - "right": { - "type": "ArrayExpression", - "elements": [ - { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 31, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 15 - }, - "end": { - "line": 31, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 22 - } - } - }, - { - "type": "AssignmentPattern", - "left": { - "type": "ObjectPattern", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - "value": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 32, - "column": 11 - }, - "end": { - "line": 32, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 14 - } - } - }, - "right": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 32, - "column": 19 - }, - "end": { - "line": 32, - "column": 20 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 32, - "column": 22 - }, - "end": { - "line": 32, - "column": 23 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 32, - "column": 19 - }, - "end": { - "line": 32, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "rest", - "loc": { - "start": { - "line": 33, - "column": 12 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 33, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 33, - "column": 21 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 33, - "column": 21 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 34, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 34, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ExampleClass2", - "loc": { - "start": { - "line": 36, - "column": 7 - }, - "end": { - "line": 36, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 37, - "column": 23 - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "readonly", - "loc": { - "start": { - "line": 37, - "column": 24 - }, - "end": { - "line": 37, - "column": 32 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 37, - "column": 34 - }, - "end": { - "line": 37, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 23 - }, - "end": { - "line": 37, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 23 - }, - "end": { - "line": 37, - "column": 37 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 37 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ExampleClass3", - "loc": { - "start": { - "line": 40, - "column": 7 - }, - "end": { - "line": 40, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 41, - "column": 12 - }, - "end": { - "line": 41, - "column": 23 - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "TSParameterProperty", - "accessibility": "public", - "readonly": false, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "readonly", - "loc": { - "start": { - "line": 41, - "column": 31 - }, - "end": { - "line": 41, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 24 - }, - "end": { - "line": 41, - "column": 39 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 41, - "column": 41 - }, - "end": { - "line": 41, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 23 - }, - "end": { - "line": 41, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 23 - }, - "end": { - "line": 41, - "column": 44 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 44 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 40, - "column": 21 - }, - "end": { - "line": 42, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 42, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ExampleClass4", - "loc": { - "start": { - "line": 44, - "column": 7 - }, - "end": { - "line": 44, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 45, - "column": 12 - }, - "end": { - "line": 45, - "column": 23 - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "TSParameterProperty", - "accessibility": "undefined", - "readonly": true, - "override": false, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "readonly", - "loc": { - "start": { - "line": 45, - "column": 33 - }, - "end": { - "line": 45, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 24 - }, - "end": { - "line": 45, - "column": 41 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 45, - "column": 43 - }, - "end": { - "line": 45, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 23 - }, - "end": { - "line": 45, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 23 - }, - "end": { - "line": 45, - "column": 46 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 46 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 44, - "column": 21 - }, - "end": { - "line": 46, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 1 - }, - "end": { - "line": 46, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 46, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-parameter-property.ts b/es2panda/test/parser/ts/test-ts-parameter-property.ts deleted file mode 100644 index b541e5476d1006b808b6385e268e41754b0a2775..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class ExampleClass1 { - public constructor( - declare = 5, - async: string = "async", - public a, - private b, - protected c, - readonly d, - public readonly e, - private readonly f, - protected readonly g, - public readonly readonly: boolean = false, - [h], - { i }, - [j] = ["foo"], - { k } = { k: 5 }, - ...rest) { }; -} - -class ExampleClass2 { - public constructor(readonly) { }; -} - -class ExampleClass3 { - public constructor(public readonly) { }; -} - -class ExampleClass4 { - public constructor(readonly readonly) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property1-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property1-expected.txt deleted file mode 100644 index 718579909bfc5203ddf7f31d95b6eeb8715cc9b5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property is only allowed in a constructor implementation. [test-ts-parameter-property1.ts:17:14] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property1.ts b/es2panda/test/parser/ts/test-ts-parameter-property1.ts deleted file mode 100644 index f03903448b459cf3799311794d4f975c9aaabfee..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function Foo(public readonly a) { } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property10-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property10-expected.txt deleted file mode 100644 index 42ff4482749e7d11e4f36b9ac238902208a1094a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property may not be declared using a binding pattern. [test-ts-parameter-property10.ts:18:17] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property10.ts b/es2panda/test/parser/ts/test-ts-parameter-property10.ts deleted file mode 100644 index e9c462008051821ba8bcd320084ae30ad8d40906..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property10.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private readonly { bar } = { bar: 2 }) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property11-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property11-expected.txt deleted file mode 100644 index f9e4c22408bad9fc6ae4c46afd030a93e5c999cd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property11-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property may not be declared using a binding pattern. [test-ts-parameter-property11.ts:18:17] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property11.ts b/es2panda/test/parser/ts/test-ts-parameter-property11.ts deleted file mode 100644 index 8eda48622846d017cdc4c739ae50310496b84808..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property11.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private readonly [bar]) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property12-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property12-expected.txt deleted file mode 100644 index c7cf1229dde23227d8122d6e813864bf1388fb0c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property12-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property may not be declared using a binding pattern. [test-ts-parameter-property12.ts:18:17] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property12.ts b/es2panda/test/parser/ts/test-ts-parameter-property12.ts deleted file mode 100644 index c4668e06f232f1ca4e02bdf26d2f572b1573c818..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property12.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private readonly { bar }) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property2-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property2-expected.txt deleted file mode 100644 index b62630136030344bf43a590e6c3fe9170053a405..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property is only allowed in a constructor implementation. [test-ts-parameter-property2.ts:19:7] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property2.ts b/es2panda/test/parser/ts/test-ts-parameter-property2.ts deleted file mode 100644 index e938aa0a9730c2de134069a20c08c2c34fd9cf2c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor() { }; - a(public a) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property3-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property3-expected.txt deleted file mode 100644 index 78542c7bdab6d556296b161b827ecb5c85137b9d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test-ts-parameter-property3.ts:18:26] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property3.ts b/es2panda/test/parser/ts/test-ts-parameter-property3.ts deleted file mode 100644 index 1ef55194300b5eb7e79de8dee41bf8adbde835bb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(readonly readonly readonly) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property4-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property4-expected.txt deleted file mode 100644 index 8b86d684f507c01000b3f95834de65a1fe666343..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'static' modifier cannot appear on a parameter. [test-ts-parameter-property4.ts:18:25] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property4.ts b/es2panda/test/parser/ts/test-ts-parameter-property4.ts deleted file mode 100644 index ab98f17984873b6319e6c1c90a98b9e13341ed6e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private static readonly readonly) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property5-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property5-expected.txt deleted file mode 100644 index fab0ce4a19dac2b48b131abba2a64bbd6723127a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'async' modifier cannot appear on a parameter. [test-ts-parameter-property5.ts:18:25] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property5.ts b/es2panda/test/parser/ts/test-ts-parameter-property5.ts deleted file mode 100644 index 904691b137d84232fff82d715c3bd5fa083895e3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property5.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private async readonly readonly) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property6-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property6-expected.txt deleted file mode 100644 index cb4cb24ad1b8b5ad01afea0adb1f87be45f82971..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'declare' modifier cannot appear on a parameter. [test-ts-parameter-property6.ts:18:25] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property6.ts b/es2panda/test/parser/ts/test-ts-parameter-property6.ts deleted file mode 100644 index d3b3cb12c1651140498a5845906c167e32c4d466..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property6.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private declare readonly readonly) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property7-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property7-expected.txt deleted file mode 100644 index f6e3ca122428b63c18b32870c29e45904a52c707..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Variable 'readonly' has already been declared. [test-ts-parameter-property7.ts:18:44] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property7.ts b/es2panda/test/parser/ts/test-ts-parameter-property7.ts deleted file mode 100644 index ccac0696d632b329f9f9f4b733c0541447783d01..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private readonly readonly, private readonly readonly) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property8-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property8-expected.txt deleted file mode 100644 index c47c4b8474af3ba4dc51c5a7c20a42c604ae040d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property cannot be declared using a rest parameter. [test-ts-parameter-property8.ts:18:17] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property8.ts b/es2panda/test/parser/ts/test-ts-parameter-property8.ts deleted file mode 100644 index 2ea5cda5aeb0905ca629ef364d9223239a70e02a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property8.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private readonly ...rest) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-parameter-property9-expected.txt b/es2panda/test/parser/ts/test-ts-parameter-property9-expected.txt deleted file mode 100644 index b84dbc445f02e538c26a33fe4fc7cbb6b15e7f18..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A parameter property may not be declared using a binding pattern. [test-ts-parameter-property9.ts:18:17] diff --git a/es2panda/test/parser/ts/test-ts-parameter-property9.ts b/es2panda/test/parser/ts/test-ts-parameter-property9.ts deleted file mode 100644 index 3d7df36d5abaa3d89cd61bebc743d4eb95d0e242..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-parameter-property9.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - constructor(private readonly [bar] = [2]) { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-1-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-1-expected.txt deleted file mode 100644 index eac4d4bc48f851410a82696ed71007b5895844d5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Private identifiers are not allowed outside class bodies. [test-ts-private-class-element-1.ts:27:4] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-1.ts b/es2panda/test/parser/ts/test-ts-private-class-element-1.ts deleted file mode 100644 index ee504b34a7f8a08b6afc2294fa5b6ed3db33d1bf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-1.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// 2. non-static methods can be named with a private identifier, and can't call it outside the class - -class C1 { - #value: number = 0; - #add() { - this.#value += 1; - } -} - -let c1: C1 = new C1(); -c1.#add(); \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-10-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-10-expected.txt deleted file mode 100644 index f4765c3567c82c8ded61781e21b04e5154bb816b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'declare' modifier cannot be used with a private identifier. [test-ts-private-class-element-10.ts:18:11] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-10.ts b/es2panda/test/parser/ts/test-ts-private-class-element-10.ts deleted file mode 100644 index 424159b9d7b4c1a5934dc3b1298964838fb1f2df..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-10.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare class DeclareModifierTest { - declare #count: number; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-11-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-11-expected.txt deleted file mode 100644 index d981d8b1d1d3ba11d2930c85ebd6efd7de1f2829..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-11-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: 'abstract' modifier cannot be used with a private identifier. [test-ts-private-class-element-11.ts:18:12] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-11.ts b/es2panda/test/parser/ts/test-ts-private-class-element-11.ts deleted file mode 100644 index 79aec5a7d06efc72b10ccd6f8f13adf213b27a5a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-11.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract class AbstractModifierTest { - abstract #count: number; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-12-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-12-expected.txt deleted file mode 100644 index 51ad607b2512679696f5d3248424c2ceea085b24..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-12-expected.txt +++ /dev/null @@ -1,1210 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "BaseClass", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 21 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "OverrideModifierTest", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "BaseClass", - "loc": { - "start": { - "line": 21, - "column": 36 - }, - "end": { - "line": 21, - "column": 45 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 22, - "column": 29 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "static": false, - "readonly": false, - "override": true, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 20 - }, - "end": { - "line": 22, - "column": 26 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 30 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 46 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "StaticModifierTest", - "loc": { - "start": { - "line": 25, - "column": 7 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 20 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 3 - }, - "end": { - "line": 26, - "column": 20 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "AccessorModifierTest", - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 27 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 30, - "column": 21 - }, - "end": { - "line": 30, - "column": 22 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 3 - }, - "end": { - "line": 30, - "column": 22 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ReadonlyModifierTest", - "loc": { - "start": { - "line": 33, - "column": 7 - }, - "end": { - "line": 33, - "column": 27 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "count", - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 18 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 34, - "column": 21 - }, - "end": { - "line": 34, - "column": 22 - } - } - }, - "static": false, - "readonly": true, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 3 - }, - "end": { - "line": 34, - "column": 22 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 33, - "column": 28 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "AsyncModifierTest", - "loc": { - "start": { - "line": 37, - "column": 7 - }, - "end": { - "line": 37, - "column": 24 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 1 - }, - "end": { - "line": 39, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "foo", - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 13 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 38, - "column": 15 - }, - "end": { - "line": 38, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 38, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 38, - "column": 17 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 3 - }, - "end": { - "line": 38, - "column": 17 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 37, - "column": 25 - }, - "end": { - "line": 39, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 1 - }, - "end": { - "line": 39, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 39, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-12.ts b/es2panda/test/parser/ts/test-ts-private-class-element-12.ts deleted file mode 100644 index a3af1999b5e93b2a4deb8f49d007d403ecc9afe2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-12.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class BaseClass { - #count: number = 1; -} - -class OverrideModifierTest extends BaseClass { - override #count: number = 0; -} - -class StaticModifierTest { - static #count = 0; -} - -class AccessorModifierTest { - accessor #count = 0; -} - -class ReadonlyModifierTest { - readonly #count = 0; -} - -class AsyncModifierTest { - async #foo(){}; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-2-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-2-expected.txt deleted file mode 100644 index 861951c7964614be80a175ab9393b6bbfe4e89b0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Private identifiers are not allowed outside class bodies. [test-ts-private-class-element-2.ts:26:4] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-2.ts b/es2panda/test/parser/ts/test-ts-private-class-element-2.ts deleted file mode 100644 index b77c2ce605add84bc4c7a04aad8688b4763d6071..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-2.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// 2. static properties and methods can be named with a private identifier, and can't call it outside the class - -class C2 { - static #message: string = "hello"; - static #say() { - return this.#message; - } -} - -C2.#say(); diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-3-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-3-expected.txt deleted file mode 100644 index 69426656e17dd62550a0bd207a6faf6c834b3c04..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Private identifiers are not allowed outside class bodies. [test-ts-private-class-element-3.ts:31:10] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-3.ts b/es2panda/test/parser/ts/test-ts-private-class-element-3.ts deleted file mode 100644 index 047acf42ca5cb03e365c3414603ffdc60ca85c1f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-3.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// 3. non-static accessors can be named with a private identifier, and can't call it outside the class - -class C3 { - #value: number = 0; - get data() { - return this.#value; - } - set #data(num: number) { - this.#value = num; - } -} - -let c3: C3 = new C3(); -c3.data = 20; -print(c3.#data) diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-4-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-4-expected.txt deleted file mode 100644 index 2985593ce9f5c86a63392c1b143d02a60b2ba5bf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Private identifiers are not allowed outside class bodies. [test-ts-private-class-element-4.ts:30:4] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-4.ts b/es2panda/test/parser/ts/test-ts-private-class-element-4.ts deleted file mode 100644 index e3671a330668d5b220c84b8d5ae4404cc0f941d1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-4.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// 4. static accessors can be named with a private identifier, and can't call it outside the class - -class C4 { - static #message: string = ""; - static get #msg() { - return this.#message; - } - - static set #msg(msg: string) { - this.#message = msg; - } -} - -C4.#msg = 'hi'; -print(C4.#msg); diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-5-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-5-expected.txt deleted file mode 100644 index a88626448ed6c69636a6957c07ab7186082d0fe7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-5-expected.txt +++ /dev/null @@ -1,3014 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 64, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "value", - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "add", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "value", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 20 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 21, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicAdd", - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 9 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "add", - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicPrint", - "loc": { - "start": { - "line": 25, - "column": 3 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "value", - "loc": { - "start": { - "line": 26, - "column": 16 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 22 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 3 - }, - "end": { - "line": 27, - "column": 4 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "message", - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 18 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 29, - "column": 29 - }, - "end": { - "line": 29, - "column": 36 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 26 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 3 - }, - "end": { - "line": 29, - "column": 36 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "say", - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 14 - } - } - }, - "kind": "method", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 31, - "column": 12 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "message", - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 12 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 32, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 32, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 32, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 3 - }, - "end": { - "line": 32, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicSay", - "loc": { - "start": { - "line": 33, - "column": 10 - }, - "end": { - "line": 33, - "column": 19 - } - } - }, - "kind": "method", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 34, - "column": 5 - }, - "end": { - "line": 34, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 15 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "say", - "loc": { - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 34, - "column": 20 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 20 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 22 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 5 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 5 - }, - "end": { - "line": 34, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 35, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 35, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 35, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 3 - }, - "end": { - "line": 35, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "data", - "loc": { - "start": { - "line": 37, - "column": 7 - }, - "end": { - "line": 37, - "column": 12 - } - } - }, - "kind": "get", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 38, - "column": 12 - }, - "end": { - "line": 38, - "column": 16 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "value", - "loc": { - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 38, - "column": 23 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 38, - "column": 12 - }, - "end": { - "line": 38, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 15 - }, - "end": { - "line": 39, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 39, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 39, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 3 - }, - "end": { - "line": 39, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "data", - "loc": { - "start": { - "line": 40, - "column": 7 - }, - "end": { - "line": 40, - "column": 12 - } - } - }, - "kind": "set", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "num", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 40, - "column": 18 - }, - "end": { - "line": 40, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 13 - }, - "end": { - "line": 40, - "column": 16 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 9 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "value", - "loc": { - "start": { - "line": 41, - "column": 10 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "right": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 41, - "column": 19 - }, - "end": { - "line": 41, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 26 - }, - "end": { - "line": 42, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 12 - }, - "end": { - "line": 42, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 12 - }, - "end": { - "line": 42, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 40, - "column": 3 - }, - "end": { - "line": 42, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicData", - "loc": { - "start": { - "line": 43, - "column": 7 - }, - "end": { - "line": 43, - "column": 17 - } - } - }, - "kind": "get", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 44, - "column": 12 - }, - "end": { - "line": 44, - "column": 16 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "data", - "loc": { - "start": { - "line": 44, - "column": 17 - }, - "end": { - "line": 44, - "column": 22 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 44, - "column": 12 - }, - "end": { - "line": 44, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 5 - }, - "end": { - "line": 44, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 43, - "column": 20 - }, - "end": { - "line": 45, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 45, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 45, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 43, - "column": 3 - }, - "end": { - "line": 45, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicData", - "loc": { - "start": { - "line": 46, - "column": 7 - }, - "end": { - "line": 46, - "column": 17 - } - } - }, - "kind": "set", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "num", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 46, - "column": 23 - }, - "end": { - "line": 46, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 18 - }, - "end": { - "line": 46, - "column": 21 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 9 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "data", - "loc": { - "start": { - "line": 47, - "column": 10 - }, - "end": { - "line": 47, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 15 - } - } - }, - "right": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 47, - "column": 18 - }, - "end": { - "line": 47, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 31 - }, - "end": { - "line": 48, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 17 - }, - "end": { - "line": 48, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 17 - }, - "end": { - "line": 48, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 3 - }, - "end": { - "line": 48, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "msg", - "loc": { - "start": { - "line": 50, - "column": 14 - }, - "end": { - "line": 50, - "column": 18 - } - } - }, - "kind": "get", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 51, - "column": 12 - }, - "end": { - "line": 51, - "column": 16 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "message", - "loc": { - "start": { - "line": 51, - "column": 17 - }, - "end": { - "line": 51, - "column": 25 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 51, - "column": 12 - }, - "end": { - "line": 51, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 5 - }, - "end": { - "line": 51, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 50, - "column": 21 - }, - "end": { - "line": 52, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 18 - }, - "end": { - "line": 52, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 18 - }, - "end": { - "line": 52, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 50, - "column": 3 - }, - "end": { - "line": 52, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "msg", - "loc": { - "start": { - "line": 54, - "column": 14 - }, - "end": { - "line": 54, - "column": 18 - } - } - }, - "kind": "set", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "msg", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 54, - "column": 24 - }, - "end": { - "line": 54, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 19 - }, - "end": { - "line": 54, - "column": 22 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 55, - "column": 5 - }, - "end": { - "line": 55, - "column": 9 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "message", - "loc": { - "start": { - "line": 55, - "column": 10 - }, - "end": { - "line": 55, - "column": 18 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 55, - "column": 5 - }, - "end": { - "line": 55, - "column": 18 - } - } - }, - "right": { - "type": "Identifier", - "name": "msg", - "loc": { - "start": { - "line": 55, - "column": 21 - }, - "end": { - "line": 55, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 5 - }, - "end": { - "line": 55, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 5 - }, - "end": { - "line": 55, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 54, - "column": 32 - }, - "end": { - "line": 56, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 18 - }, - "end": { - "line": 56, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 18 - }, - "end": { - "line": 56, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 3 - }, - "end": { - "line": 56, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicMsg", - "loc": { - "start": { - "line": 58, - "column": 14 - }, - "end": { - "line": 58, - "column": 23 - } - } - }, - "kind": "set", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "msg", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 58, - "column": 29 - }, - "end": { - "line": 58, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 58, - "column": 24 - }, - "end": { - "line": 58, - "column": 27 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 59, - "column": 5 - }, - "end": { - "line": 59, - "column": 9 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "msg", - "loc": { - "start": { - "line": 59, - "column": 10 - }, - "end": { - "line": 59, - "column": 14 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 59, - "column": 5 - }, - "end": { - "line": 59, - "column": 14 - } - } - }, - "right": { - "type": "Identifier", - "name": "msg", - "loc": { - "start": { - "line": 59, - "column": 17 - }, - "end": { - "line": 59, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 5 - }, - "end": { - "line": 59, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 5 - }, - "end": { - "line": 59, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 58, - "column": 37 - }, - "end": { - "line": 60, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 58, - "column": 23 - }, - "end": { - "line": 60, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 58, - "column": 23 - }, - "end": { - "line": 60, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 58, - "column": 3 - }, - "end": { - "line": 60, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "publicMsg", - "loc": { - "start": { - "line": 61, - "column": 14 - }, - "end": { - "line": 61, - "column": 23 - } - } - }, - "kind": "get", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 62, - "column": 12 - }, - "end": { - "line": 62, - "column": 16 - } - } - }, - "property": { - "type": "PrivateIdentifier", - "prefix": "#", - "name": "msg", - "loc": { - "start": { - "line": 62, - "column": 17 - }, - "end": { - "line": 62, - "column": 21 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 62, - "column": 12 - }, - "end": { - "line": 62, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 5 - }, - "end": { - "line": 62, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 61, - "column": 26 - }, - "end": { - "line": 63, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 23 - }, - "end": { - "line": 63, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 23 - }, - "end": { - "line": 63, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 61, - "column": 3 - }, - "end": { - "line": 63, - "column": 4 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 64, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 64, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 66, - "column": 8 - }, - "end": { - "line": 66, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 8 - }, - "end": { - "line": 66, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 5 - }, - "end": { - "line": 66, - "column": 6 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 66, - "column": 16 - }, - "end": { - "line": 66, - "column": 17 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 66, - "column": 12 - }, - "end": { - "line": 66, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 5 - }, - "end": { - "line": 66, - "column": 19 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 66, - "column": 1 - }, - "end": { - "line": 66, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 67, - "column": 1 - }, - "end": { - "line": 67, - "column": 2 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicAdd", - "loc": { - "start": { - "line": 67, - "column": 3 - }, - "end": { - "line": 67, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 67, - "column": 1 - }, - "end": { - "line": 67, - "column": 12 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 67, - "column": 1 - }, - "end": { - "line": 67, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 67, - "column": 1 - }, - "end": { - "line": 67, - "column": 15 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 68, - "column": 1 - }, - "end": { - "line": 68, - "column": 2 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicPrint", - "loc": { - "start": { - "line": 68, - "column": 3 - }, - "end": { - "line": 68, - "column": 14 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 68, - "column": 1 - }, - "end": { - "line": 68, - "column": 14 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 68, - "column": 1 - }, - "end": { - "line": 68, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 68, - "column": 1 - }, - "end": { - "line": 68, - "column": 17 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 69, - "column": 1 - }, - "end": { - "line": 69, - "column": 2 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicSay", - "loc": { - "start": { - "line": 69, - "column": 3 - }, - "end": { - "line": 69, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 69, - "column": 1 - }, - "end": { - "line": 69, - "column": 12 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 69, - "column": 1 - }, - "end": { - "line": 69, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 1 - }, - "end": { - "line": 69, - "column": 15 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 70, - "column": 1 - }, - "end": { - "line": 70, - "column": 2 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicData", - "loc": { - "start": { - "line": 70, - "column": 3 - }, - "end": { - "line": 70, - "column": 13 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 70, - "column": 1 - }, - "end": { - "line": 70, - "column": 13 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 20, - "loc": { - "start": { - "line": 70, - "column": 16 - }, - "end": { - "line": 70, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 70, - "column": 1 - }, - "end": { - "line": 70, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 70, - "column": 1 - }, - "end": { - "line": 70, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 71, - "column": 7 - }, - "end": { - "line": 71, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicData", - "loc": { - "start": { - "line": 71, - "column": 9 - }, - "end": { - "line": 71, - "column": 19 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 71, - "column": 7 - }, - "end": { - "line": 71, - "column": 19 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 2 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicMsg", - "loc": { - "start": { - "line": 72, - "column": 3 - }, - "end": { - "line": 72, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 12 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "hi", - "loc": { - "start": { - "line": 72, - "column": 15 - }, - "end": { - "line": 72, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 20 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 73, - "column": 7 - }, - "end": { - "line": 73, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "publicMsg", - "loc": { - "start": { - "line": 73, - "column": 9 - }, - "end": { - "line": 73, - "column": 18 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 73, - "column": 7 - }, - "end": { - "line": 73, - "column": 18 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 75, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-5.ts b/es2panda/test/parser/ts/test-ts-private-class-element-5.ts deleted file mode 100644 index eeefdea341cf9cc56844fb052b2f44530041590d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-5.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class C { - #value: number = 0; - #add() { - this.#value += 1; - } - publicAdd() { - this.#add(); - } - publicPrint() { - print(this.#value); - } - - static #message: string = "hello"; - static #say() { - return this.#message; - } - static publicSay() { - print(this.#say()); - } - - get #data() { - return this.#value; - } - set #data(num: number) { - this.#value = num; - } - get publicData() { - return this.#data; - } - set publicData(num: number) { - this.#data = num; - } - - static get #msg() { - return this.#message; - } - - static set #msg(msg: string) { - this.#message = msg; - } - - static set publicMsg(msg: string) { - this.#msg = msg; - } - static get publicMsg() { - return this.#msg; - } -} - -let c: C = new C(); -c.publicAdd(); -c.publicPrint(); -C.publicSay(); -c.publicData = 20; -print(c.publicData) -C.publicMsg = 'hi'; -print(C.publicMsg); - diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-6-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-6-expected.txt deleted file mode 100644 index e7e7978f8698fc812180b5ddc93116ec8bf33d67..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An accessibility modifier cannot be used with a private identifier. [test-ts-private-class-element-6.ts:18:10] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-6.ts b/es2panda/test/parser/ts/test-ts-private-class-element-6.ts deleted file mode 100644 index cb4b3f7ff0d02622054bcaa283b4d08a16477e66..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-6.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class PublicModifierTest { - public #count: number = 0; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-7-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-7-expected.txt deleted file mode 100644 index 3bd0f059fb5f951eb2b887b8599fb8a7a2acc7be..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An accessibility modifier cannot be used with a private identifier. [test-ts-private-class-element-7.ts:18:11] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-7.ts b/es2panda/test/parser/ts/test-ts-private-class-element-7.ts deleted file mode 100644 index 7119d13dc82b6af0f04b375d5391fbfda538169a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class PrivateModifierTest { - private #count: number = 0; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-8-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-8-expected.txt deleted file mode 100644 index 0f98d57f2913d6ae15510443d51d2145604d1d10..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: An accessibility modifier cannot be used with a private identifier. [test-ts-private-class-element-8.ts:18:13] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-8.ts b/es2panda/test/parser/ts/test-ts-private-class-element-8.ts deleted file mode 100644 index 5e984b3f5764ab249d8e875175c9f9dc27dddb0b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-8.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class ProtectedModifierTest { - protected #count: number = 0; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-9-expected.txt b/es2panda/test/parser/ts/test-ts-private-class-element-9-expected.txt deleted file mode 100644 index fb94581e5e8ae5140670aacd9ad42eb2ba5c85ff..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ';' expected. [test-ts-private-class-element-9.ts:18:10] diff --git a/es2panda/test/parser/ts/test-ts-private-class-element-9.ts b/es2panda/test/parser/ts/test-ts-private-class-element-9.ts deleted file mode 100644 index 67980d8d28f9e1030d4a456b3ef2c35b4524e2a0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-private-class-element-9.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class ExportModifierTest { - export #count = 0; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-symbol-type-expected.txt b/es2panda/test/parser/ts/test-ts-symbol-type-expected.txt deleted file mode 100644 index 4bab2c2a656626d3f38cb38cce0fe37d6d8a55e2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-symbol-type-expected.txt +++ /dev/null @@ -1,263 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "Symbol", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 30 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 31 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "symbolVar", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": true, - "key": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-symbol-type.ts b/es2panda/test/parser/ts/test-ts-symbol-type.ts deleted file mode 100644 index 8b2e79d3b47b7d122067a754d80f0303130399dd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-symbol-type.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var s : symbol = Symbol("foo"); -var symbolVar = { - a : 1, - [s] : "string", -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-ternary-operator-1-expected.txt b/es2panda/test/parser/ts/test-ts-ternary-operator-1-expected.txt deleted file mode 100644 index 4a5532dce964b5b78f3b372f5cc00d0bb657c730..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-ternary-operator-1-expected.txt +++ /dev/null @@ -1,319 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "getPropAccessor", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "key", - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 29 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ConditionalExpression", - "test": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "test", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "key", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 20 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "consequent": { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "Identifier", - "name": "key", - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 32 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": ".", - "cooked": "." - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "alternate": { - "type": "TemplateLiteral", - "expressions": [ - { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "escapeForJS", - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "key", - "loc": { - "start": { - "line": 18, - "column": 55 - }, - "end": { - "line": 18, - "column": 58 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 59 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "[", - "cooked": "[" - }, - "loc": { - "start": { - "line": 18, - "column": 40 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "]", - "cooked": "]" - }, - "loc": { - "start": { - "line": 18, - "column": 60 - }, - "end": { - "line": 18, - "column": 61 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 38 - }, - "end": { - "line": 18, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 64 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-ternary-operator-1.ts b/es2panda/test/parser/ts/test-ts-ternary-operator-1.ts deleted file mode 100644 index 8c3b493b05c16f380e3b3eb03705cd8c3d637f20..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-ternary-operator-1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function getPropAccessor(key) { - return test(key) ? (`.${key}`) : (`[${escapeForJS(key)}]`); -} diff --git a/es2panda/test/parser/ts/test-ts-ternary-operator-2-expected.txt b/es2panda/test/parser/ts/test-ts-ternary-operator-2-expected.txt deleted file mode 100644 index b2e9f62cfe5d585f2a31ffe78ac265d36f996e09..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-ternary-operator-2-expected.txt +++ /dev/null @@ -1,1389 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "consequent": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "alternate": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 43 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "1", - "loc": { - "start": { - "line": 17, - "column": 62 - }, - "end": { - "line": 17, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 55 - }, - "end": { - "line": 17, - "column": 66 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 68 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "consequent": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "alternate": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "p1", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 44 - }, - "end": { - "line": 18, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 40 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - { - "type": "Identifier", - "name": "p2", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 56 - }, - "end": { - "line": 18, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 52 - }, - "end": { - "line": 18, - "column": 54 - } - } - } - ], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 65 - }, - "end": { - "line": 18, - "column": 71 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "1", - "loc": { - "start": { - "line": 18, - "column": 84 - }, - "end": { - "line": 18, - "column": 87 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 77 - }, - "end": { - "line": 18, - "column": 88 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 75 - }, - "end": { - "line": 18, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 90 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "consequent": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "p", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 41 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 34 - }, - "end": { - "line": 19, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "alternate": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 52 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "1", - "loc": { - "start": { - "line": 19, - "column": 71 - }, - "end": { - "line": 19, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 64 - }, - "end": { - "line": 19, - "column": 75 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 62 - }, - "end": { - "line": 19, - "column": 77 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 48 - }, - "end": { - "line": 19, - "column": 77 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 48 - }, - "end": { - "line": 19, - "column": 77 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 77 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 77 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 13 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 24 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "consequent": { - "type": "SequenceExpression", - "expressions": [ - { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "alternate": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "consequent": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - { - "type": "AssignmentPattern", - "left": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 22 - } - } - } - ], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 41 - }, - "end": { - "line": 23, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 34 - }, - "end": { - "line": 23, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 32 - }, - "end": { - "line": 23, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 44 - } - } - }, - "alternate": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 23, - "column": 47 - }, - "end": { - "line": 23, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-ternary-operator-2.ts b/es2panda/test/parser/ts/test-ts-ternary-operator-2.ts deleted file mode 100644 index 883818e4f337e1b600d5b053d1da8981562e1152..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-ternary-operator-2.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -1 < 2 ? (): number => { return 1; } : (): string => { return "1"; } -1 < 2 ? (): number => { return 1; } : (p1: number, p2: string): string => { return "1"; } -1 < 2 ? (p: string): number => { return 1; } : (): string => { return "1"; } - -var a = 1, b = 2, c = 3; -1 < 2 ? (a = 1, b = 2) : c -1 < 2 ? (a = 1, b = 2): any => { return b } : c diff --git a/es2panda/test/parser/ts/test-ts-ternary-operator-3-expected.txt b/es2panda/test/parser/ts/test-ts-ternary-operator-3-expected.txt deleted file mode 100644 index ff367311698b0a6fa6cf6c45eb1239f500e44572..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-ternary-operator-3-expected.txt +++ /dev/null @@ -1,324 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "isConnect", - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 14 - } - } - }, - "init": { - "type": "BooleanLiteral", - "value": false, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 22 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "time", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 13 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "ConditionalExpression", - "test": { - "type": "Identifier", - "name": "isConnect", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "consequent": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "alternate": { - "type": "ConditionalExpression", - "test": { - "type": "BinaryExpression", - "operator": "==", - "left": { - "type": "Identifier", - "name": "time", - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 37 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 43 - } - } - }, - "consequent": { - "type": "NumberLiteral", - "value": 10, - "loc": { - "start": { - "line": 18, - "column": 46 - }, - "end": { - "line": 18, - "column": 48 - } - } - }, - "alternate": { - "type": "Identifier", - "name": "time", - "loc": { - "start": { - "line": 18, - "column": 51 - }, - "end": { - "line": 18, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 56 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-ternary-operator-3.ts b/es2panda/test/parser/ts/test-ts-ternary-operator-3.ts deleted file mode 100644 index 26a10313f7b3e121b53117610967330285ad900e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-ternary-operator-3.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -let isConnect = false; -let time = 1; -let v = isConnect ? (2 + 3) : ((time == 0) ? 10 : time); diff --git a/es2panda/test/parser/ts/test-ts-type-alias-declaration-expected.txt b/es2panda/test/parser/ts/test-ts-type-alias-declaration-expected.txt deleted file mode 100644 index 906377f47cc09dc243cf9e89b039e362fa726131..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-alias-declaration-expected.txt +++ /dev/null @@ -1,150 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 26 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-type-alias-declaration.ts b/es2panda/test/parser/ts/test-ts-type-alias-declaration.ts deleted file mode 100644 index 2477448b6b7d5dbe538be401ecdc273cb319e8d7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-alias-declaration.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type A = number -declare type B = string; -declare type C = string;; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-type-assertion-expected.txt b/es2panda/test/parser/ts/test-ts-type-assertion-expected.txt deleted file mode 100644 index 519f1087cd4ebfe0bbf247d0ec1e419e40b87555..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-assertion-expected.txt +++ /dev/null @@ -1,294 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "id": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "init": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "expression": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 24 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "goo", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "init": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "expression": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 19 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 19 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-type-assertion.ts b/es2panda/test/parser/ts/test-ts-type-assertion.ts deleted file mode 100644 index 8686a05c1f1384e6f07ab5e09f6d1d022139b0d1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-assertion.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface C {} -var foo: any; -var bar = foo; -var goo = foo; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-type-predicate-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate-expected.txt deleted file mode 100644 index cbdf350db9c06f5f4d6cbd2a4563119f9cf2ffad..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate-expected.txt +++ /dev/null @@ -1,5815 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function1", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 21 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 49 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - "typeAnnotation": null, - "asserts": true, - "loc": { - "start": { - "line": 17, - "column": 41 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 61 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 61 - }, - "end": { - "line": 17, - "column": 62 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var1", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 44 - } - } - }, - "typeAnnotation": null, - "asserts": true, - "loc": { - "start": { - "line": 18, - "column": 35 - }, - "end": { - "line": 18, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 36 - } - } - }, - "typeAnnotation": null, - "asserts": true, - "loc": { - "start": { - "line": 20, - "column": 27 - }, - "end": { - "line": 20, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "TSThisType", - "loc": { - "start": { - "line": 21, - "column": 35 - }, - "end": { - "line": 21, - "column": 39 - } - } - }, - "typeAnnotation": null, - "asserts": true, - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface1", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function2", - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 38 - }, - "end": { - "line": 24, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 24, - "column": 47 - }, - "end": { - "line": 24, - "column": 54 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 58 - }, - "end": { - "line": 24, - "column": 64 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 24, - "column": 47 - }, - "end": { - "line": 24, - "column": 64 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 24, - "column": 67 - }, - "end": { - "line": 24, - "column": 73 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 65 - }, - "end": { - "line": 24, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 75 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 24, - "column": 75 - }, - "end": { - "line": 24, - "column": 76 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var2", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 25, - "column": 30 - }, - "end": { - "line": 25, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 25, - "column": 41 - }, - "end": { - "line": 25, - "column": 48 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 52 - }, - "end": { - "line": 25, - "column": 58 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 25, - "column": 41 - }, - "end": { - "line": 25, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 59 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 27, - "column": 8 - }, - "end": { - "line": 27, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 28, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 28, - "column": 33 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 28, - "column": 44 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 28, - "column": 33 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 51 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 26 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 29, - "column": 29 - }, - "end": { - "line": 29, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 29, - "column": 40 - }, - "end": { - "line": 29, - "column": 47 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 29, - "column": 51 - }, - "end": { - "line": 29, - "column": 55 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 29, - "column": 40 - }, - "end": { - "line": 29, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 30, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface2", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 30, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function3", - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 32, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 32, - "column": 24 - }, - "end": { - "line": 32, - "column": 30 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 32, - "column": 33 - }, - "end": { - "line": 32, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 24 - }, - "end": { - "line": 32, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 20 - }, - "end": { - "line": 32, - "column": 22 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 32, - "column": 42 - }, - "end": { - "line": 32, - "column": 44 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 32, - "column": 48 - }, - "end": { - "line": 32, - "column": 54 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 32, - "column": 42 - }, - "end": { - "line": 32, - "column": 54 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 32, - "column": 57 - }, - "end": { - "line": 32, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 55 - }, - "end": { - "line": 32, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 65 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 32, - "column": 65 - }, - "end": { - "line": 32, - "column": 66 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var3", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 33, - "column": 16 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 33, - "column": 25 - }, - "end": { - "line": 33, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 16 - }, - "end": { - "line": 33, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 12 - }, - "end": { - "line": 33, - "column": 14 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 33, - "column": 36 - }, - "end": { - "line": 33, - "column": 38 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 33, - "column": 42 - }, - "end": { - "line": 33, - "column": 48 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 33, - "column": 36 - }, - "end": { - "line": 33, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 49 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 35, - "column": 8 - }, - "end": { - "line": 35, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 15 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 36, - "column": 16 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 36, - "column": 19 - }, - "end": { - "line": 36, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 36, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 6 - }, - "end": { - "line": 36, - "column": 8 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 36, - "column": 28 - }, - "end": { - "line": 36, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 36, - "column": 34 - }, - "end": { - "line": 36, - "column": 40 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 36, - "column": 28 - }, - "end": { - "line": 36, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 41 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 37, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 37, - "column": 15 - }, - "end": { - "line": 37, - "column": 21 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 37, - "column": 24 - }, - "end": { - "line": 37, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 15 - }, - "end": { - "line": 37, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 37, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 10 - }, - "end": { - "line": 37, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 6 - }, - "end": { - "line": 37, - "column": 8 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 37, - "column": 35 - }, - "end": { - "line": 37, - "column": 37 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 37, - "column": 41 - }, - "end": { - "line": 37, - "column": 45 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 37, - "column": 35 - }, - "end": { - "line": 37, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface3", - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function4", - "loc": { - "start": { - "line": 40, - "column": 10 - }, - "end": { - "line": 40, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 40, - "column": 23 - }, - "end": { - "line": 40, - "column": 29 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 40, - "column": 32 - }, - "end": { - "line": 40, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 23 - }, - "end": { - "line": 40, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 20 - }, - "end": { - "line": 40, - "column": 21 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 40, - "column": 41 - }, - "end": { - "line": 40, - "column": 42 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 40, - "column": 46 - }, - "end": { - "line": 40, - "column": 52 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 40, - "column": 41 - }, - "end": { - "line": 40, - "column": 52 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 40, - "column": 55 - }, - "end": { - "line": 40, - "column": 61 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 53 - }, - "end": { - "line": 40, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 63 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 40, - "column": 63 - }, - "end": { - "line": 40, - "column": 64 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var4", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 41, - "column": 15 - }, - "end": { - "line": 41, - "column": 21 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 41, - "column": 24 - }, - "end": { - "line": 41, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 15 - }, - "end": { - "line": 41, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 12 - }, - "end": { - "line": 41, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 41, - "column": 35 - }, - "end": { - "line": 41, - "column": 36 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 41, - "column": 40 - }, - "end": { - "line": 41, - "column": 46 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 41, - "column": 35 - }, - "end": { - "line": 41, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 11 - }, - "end": { - "line": 41, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 41, - "column": 1 - }, - "end": { - "line": 41, - "column": 47 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 43, - "column": 8 - }, - "end": { - "line": 43, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 15 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 44, - "column": 9 - }, - "end": { - "line": 44, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 44, - "column": 18 - }, - "end": { - "line": 44, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 44, - "column": 9 - }, - "end": { - "line": 44, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 6 - }, - "end": { - "line": 44, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 44, - "column": 27 - }, - "end": { - "line": 44, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 44, - "column": 32 - }, - "end": { - "line": 44, - "column": 38 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 44, - "column": 27 - }, - "end": { - "line": 44, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 5 - }, - "end": { - "line": 44, - "column": 39 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 45, - "column": 11 - }, - "end": { - "line": 45, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 45, - "column": 14 - }, - "end": { - "line": 45, - "column": 20 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 45, - "column": 23 - }, - "end": { - "line": 45, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 45, - "column": 14 - }, - "end": { - "line": 45, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 11 - }, - "end": { - "line": 45, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 45, - "column": 9 - }, - "end": { - "line": 45, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 6 - }, - "end": { - "line": 45, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 45, - "column": 34 - }, - "end": { - "line": 45, - "column": 35 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 45, - "column": 39 - }, - "end": { - "line": 45, - "column": 43 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 45, - "column": 34 - }, - "end": { - "line": 45, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 22 - }, - "end": { - "line": 46, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface4", - "loc": { - "start": { - "line": 42, - "column": 11 - }, - "end": { - "line": 42, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 46, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function5", - "loc": { - "start": { - "line": 48, - "column": 10 - }, - "end": { - "line": 48, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 48, - "column": 23 - }, - "end": { - "line": 48, - "column": 29 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 48, - "column": 32 - }, - "end": { - "line": 48, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 48, - "column": 23 - }, - "end": { - "line": 48, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 21 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 48, - "column": 49 - }, - "end": { - "line": 48, - "column": 50 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 48, - "column": 54 - }, - "end": { - "line": 48, - "column": 60 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 48, - "column": 41 - }, - "end": { - "line": 48, - "column": 60 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 48, - "column": 63 - }, - "end": { - "line": 48, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 48, - "column": 61 - }, - "end": { - "line": 48, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 1 - }, - "end": { - "line": 48, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 1 - }, - "end": { - "line": 48, - "column": 71 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 48, - "column": 71 - }, - "end": { - "line": 48, - "column": 72 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var5", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 49, - "column": 15 - }, - "end": { - "line": 49, - "column": 21 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 49, - "column": 24 - }, - "end": { - "line": 49, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 49, - "column": 15 - }, - "end": { - "line": 49, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 12 - }, - "end": { - "line": 49, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 49, - "column": 43 - }, - "end": { - "line": 49, - "column": 44 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 49, - "column": 48 - }, - "end": { - "line": 49, - "column": 54 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 49, - "column": 35 - }, - "end": { - "line": 49, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 11 - }, - "end": { - "line": 49, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 5 - }, - "end": { - "line": 49, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 49, - "column": 5 - }, - "end": { - "line": 49, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 49, - "column": 1 - }, - "end": { - "line": 49, - "column": 55 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 51, - "column": 5 - }, - "end": { - "line": 51, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 51, - "column": 8 - }, - "end": { - "line": 51, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 5 - }, - "end": { - "line": 51, - "column": 15 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 52, - "column": 9 - }, - "end": { - "line": 52, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 52, - "column": 18 - }, - "end": { - "line": 52, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 52, - "column": 9 - }, - "end": { - "line": 52, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 6 - }, - "end": { - "line": 52, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 52, - "column": 35 - }, - "end": { - "line": 52, - "column": 36 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 52, - "column": 40 - }, - "end": { - "line": 52, - "column": 46 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 52, - "column": 27 - }, - "end": { - "line": 52, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 5 - }, - "end": { - "line": 52, - "column": 47 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 53, - "column": 11 - }, - "end": { - "line": 53, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 53, - "column": 14 - }, - "end": { - "line": 53, - "column": 20 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 53, - "column": 23 - }, - "end": { - "line": 53, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 14 - }, - "end": { - "line": 53, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 11 - }, - "end": { - "line": 53, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 9 - }, - "end": { - "line": 53, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 6 - }, - "end": { - "line": 53, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 53, - "column": 42 - }, - "end": { - "line": 53, - "column": 43 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 53, - "column": 47 - }, - "end": { - "line": 53, - "column": 51 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 53, - "column": 34 - }, - "end": { - "line": 53, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 5 - }, - "end": { - "line": 53, - "column": 52 - } - } - } - ], - "loc": { - "start": { - "line": 50, - "column": 22 - }, - "end": { - "line": 54, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface5", - "loc": { - "start": { - "line": 50, - "column": 11 - }, - "end": { - "line": 50, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 50, - "column": 1 - }, - "end": { - "line": 54, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function6", - "loc": { - "start": { - "line": 56, - "column": 10 - }, - "end": { - "line": 56, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 56, - "column": 29 - }, - "end": { - "line": 56, - "column": 35 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 56, - "column": 38 - }, - "end": { - "line": 56, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 56, - "column": 29 - }, - "end": { - "line": 56, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 56, - "column": 20 - }, - "end": { - "line": 56, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 56, - "column": 55 - }, - "end": { - "line": 56, - "column": 62 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 56, - "column": 66 - }, - "end": { - "line": 56, - "column": 72 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 56, - "column": 47 - }, - "end": { - "line": 56, - "column": 72 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 56, - "column": 75 - }, - "end": { - "line": 56, - "column": 81 - } - } - } - ], - "loc": { - "start": { - "line": 56, - "column": 73 - }, - "end": { - "line": 56, - "column": 83 - } - } - }, - "loc": { - "start": { - "line": 56, - "column": 1 - }, - "end": { - "line": 56, - "column": 83 - } - } - }, - "loc": { - "start": { - "line": 56, - "column": 1 - }, - "end": { - "line": 56, - "column": 83 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 56, - "column": 83 - }, - "end": { - "line": 56, - "column": 84 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var6", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 57, - "column": 21 - }, - "end": { - "line": 57, - "column": 27 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 57, - "column": 30 - }, - "end": { - "line": 57, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 57, - "column": 21 - }, - "end": { - "line": 57, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 12 - }, - "end": { - "line": 57, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 57, - "column": 49 - }, - "end": { - "line": 57, - "column": 56 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 57, - "column": 60 - }, - "end": { - "line": 57, - "column": 66 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 57, - "column": 41 - }, - "end": { - "line": 57, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 11 - }, - "end": { - "line": 57, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 5 - }, - "end": { - "line": 57, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 57, - "column": 5 - }, - "end": { - "line": 57, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 57, - "column": 1 - }, - "end": { - "line": 57, - "column": 67 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 59, - "column": 5 - }, - "end": { - "line": 59, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 59, - "column": 8 - }, - "end": { - "line": 59, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 5 - }, - "end": { - "line": 59, - "column": 15 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 60, - "column": 15 - }, - "end": { - "line": 60, - "column": 21 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 60, - "column": 24 - }, - "end": { - "line": 60, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 60, - "column": 15 - }, - "end": { - "line": 60, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 60, - "column": 6 - }, - "end": { - "line": 60, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 60, - "column": 41 - }, - "end": { - "line": 60, - "column": 48 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 60, - "column": 52 - }, - "end": { - "line": 60, - "column": 58 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 60, - "column": 33 - }, - "end": { - "line": 60, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 60, - "column": 5 - }, - "end": { - "line": 60, - "column": 59 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "asserts", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 61, - "column": 17 - }, - "end": { - "line": 61, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 61, - "column": 20 - }, - "end": { - "line": 61, - "column": 26 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 61, - "column": 29 - }, - "end": { - "line": 61, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 61, - "column": 20 - }, - "end": { - "line": 61, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 17 - }, - "end": { - "line": 61, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 61, - "column": 15 - }, - "end": { - "line": 61, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 6 - }, - "end": { - "line": 61, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 61, - "column": 48 - }, - "end": { - "line": 61, - "column": 55 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 61, - "column": 59 - }, - "end": { - "line": 61, - "column": 63 - } - } - }, - "asserts": true, - "loc": { - "start": { - "line": 61, - "column": 40 - }, - "end": { - "line": 61, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 5 - }, - "end": { - "line": 61, - "column": 64 - } - } - } - ], - "loc": { - "start": { - "line": 58, - "column": 22 - }, - "end": { - "line": 62, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface6", - "loc": { - "start": { - "line": 58, - "column": 11 - }, - "end": { - "line": 58, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 58, - "column": 1 - }, - "end": { - "line": 62, - "column": 2 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 64, - "column": 6 - }, - "end": { - "line": 64, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 64, - "column": 11 - }, - "end": { - "line": 64, - "column": 17 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 64, - "column": 20 - }, - "end": { - "line": 64, - "column": 26 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 64, - "column": 29 - }, - "end": { - "line": 64, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 64, - "column": 11 - }, - "end": { - "line": 64, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 1 - }, - "end": { - "line": 64, - "column": 37 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function7", - "loc": { - "start": { - "line": 66, - "column": 10 - }, - "end": { - "line": 66, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 66, - "column": 24 - }, - "end": { - "line": 66, - "column": 30 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 66, - "column": 33 - }, - "end": { - "line": 66, - "column": 39 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 66, - "column": 42 - }, - "end": { - "line": 66, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 42 - }, - "end": { - "line": 66, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 66, - "column": 24 - }, - "end": { - "line": 66, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 20 - }, - "end": { - "line": 66, - "column": 22 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 66, - "column": 47 - }, - "end": { - "line": 66, - "column": 49 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 66, - "column": 53 - }, - "end": { - "line": 66, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 53 - }, - "end": { - "line": 66, - "column": 55 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 66, - "column": 47 - }, - "end": { - "line": 66, - "column": 55 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 66, - "column": 58 - }, - "end": { - "line": 66, - "column": 64 - } - } - } - ], - "loc": { - "start": { - "line": 66, - "column": 56 - }, - "end": { - "line": 66, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 1 - }, - "end": { - "line": 66, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 1 - }, - "end": { - "line": 66, - "column": 66 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 66, - "column": 66 - }, - "end": { - "line": 66, - "column": 67 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var7", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 67, - "column": 16 - }, - "end": { - "line": 67, - "column": 22 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 67, - "column": 25 - }, - "end": { - "line": 67, - "column": 31 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 67, - "column": 34 - }, - "end": { - "line": 67, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 67, - "column": 34 - }, - "end": { - "line": 67, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 67, - "column": 16 - }, - "end": { - "line": 67, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 67, - "column": 12 - }, - "end": { - "line": 67, - "column": 14 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 67, - "column": 41 - }, - "end": { - "line": 67, - "column": 43 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 67, - "column": 47 - }, - "end": { - "line": 67, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 67, - "column": 47 - }, - "end": { - "line": 67, - "column": 49 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 67, - "column": 41 - }, - "end": { - "line": 67, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 67, - "column": 11 - }, - "end": { - "line": 67, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 67, - "column": 5 - }, - "end": { - "line": 67, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 67, - "column": 5 - }, - "end": { - "line": 67, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 67, - "column": 1 - }, - "end": { - "line": 67, - "column": 50 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 69, - "column": 10 - }, - "end": { - "line": 69, - "column": 16 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 69, - "column": 19 - }, - "end": { - "line": 69, - "column": 25 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 69, - "column": 28 - }, - "end": { - "line": 69, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 28 - }, - "end": { - "line": 69, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 10 - }, - "end": { - "line": 69, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 6 - }, - "end": { - "line": 69, - "column": 8 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 69, - "column": 33 - }, - "end": { - "line": 69, - "column": 35 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 69, - "column": 39 - }, - "end": { - "line": 69, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 39 - }, - "end": { - "line": 69, - "column": 41 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 69, - "column": 33 - }, - "end": { - "line": 69, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 5 - }, - "end": { - "line": 69, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 68, - "column": 22 - }, - "end": { - "line": 70, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface7", - "loc": { - "start": { - "line": 68, - "column": 11 - }, - "end": { - "line": 68, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 68, - "column": 1 - }, - "end": { - "line": 70, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function8", - "loc": { - "start": { - "line": 72, - "column": 10 - }, - "end": { - "line": 72, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "string", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 72, - "column": 28 - }, - "end": { - "line": 72, - "column": 34 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 72, - "column": 37 - }, - "end": { - "line": 72, - "column": 43 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 72, - "column": 46 - }, - "end": { - "line": 72, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 46 - }, - "end": { - "line": 72, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 72, - "column": 28 - }, - "end": { - "line": 72, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 20 - }, - "end": { - "line": 72, - "column": 26 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "string", - "loc": { - "start": { - "line": 72, - "column": 51 - }, - "end": { - "line": 72, - "column": 57 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 72, - "column": 61 - }, - "end": { - "line": 72, - "column": 67 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 72, - "column": 51 - }, - "end": { - "line": 72, - "column": 67 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": null, - "loc": { - "start": { - "line": 72, - "column": 70 - }, - "end": { - "line": 72, - "column": 76 - } - } - } - ], - "loc": { - "start": { - "line": 72, - "column": 68 - }, - "end": { - "line": 72, - "column": 78 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 78 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 78 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 72, - "column": 78 - }, - "end": { - "line": 72, - "column": 79 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "var8", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "string", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 73, - "column": 20 - }, - "end": { - "line": 73, - "column": 26 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 73, - "column": 29 - }, - "end": { - "line": 73, - "column": 35 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 73, - "column": 38 - }, - "end": { - "line": 73, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 38 - }, - "end": { - "line": 73, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 73, - "column": 20 - }, - "end": { - "line": 73, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 12 - }, - "end": { - "line": 73, - "column": 18 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "string", - "loc": { - "start": { - "line": 73, - "column": 45 - }, - "end": { - "line": 73, - "column": 51 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 73, - "column": 55 - }, - "end": { - "line": 73, - "column": 61 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 73, - "column": 45 - }, - "end": { - "line": 73, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 11 - }, - "end": { - "line": 73, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 5 - }, - "end": { - "line": 73, - "column": 9 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 73, - "column": 5 - }, - "end": { - "line": 73, - "column": 9 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 62 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 75, - "column": 5 - }, - "end": { - "line": 75, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 75, - "column": 8 - }, - "end": { - "line": 75, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 75, - "column": 8 - }, - "end": { - "line": 75, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 75, - "column": 5 - }, - "end": { - "line": 75, - "column": 11 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "string", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 76, - "column": 14 - }, - "end": { - "line": 76, - "column": 20 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 76, - "column": 23 - }, - "end": { - "line": 76, - "column": 29 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 76, - "column": 32 - }, - "end": { - "line": 76, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 32 - }, - "end": { - "line": 76, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 76, - "column": 14 - }, - "end": { - "line": 76, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 6 - }, - "end": { - "line": 76, - "column": 12 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "string", - "loc": { - "start": { - "line": 76, - "column": 37 - }, - "end": { - "line": 76, - "column": 43 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 76, - "column": 47 - }, - "end": { - "line": 76, - "column": 53 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 76, - "column": 37 - }, - "end": { - "line": 76, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 5 - }, - "end": { - "line": 76, - "column": 54 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "string", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 77, - "column": 16 - }, - "end": { - "line": 77, - "column": 17 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 77, - "column": 19 - }, - "end": { - "line": 77, - "column": 25 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 77, - "column": 28 - }, - "end": { - "line": 77, - "column": 34 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 77, - "column": 37 - }, - "end": { - "line": 77, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 37 - }, - "end": { - "line": 77, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 77, - "column": 19 - }, - "end": { - "line": 77, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 16 - }, - "end": { - "line": 77, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 77, - "column": 14 - }, - "end": { - "line": 77, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 6 - }, - "end": { - "line": 77, - "column": 12 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "string", - "loc": { - "start": { - "line": 77, - "column": 44 - }, - "end": { - "line": 77, - "column": 50 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 77, - "column": 54 - }, - "end": { - "line": 77, - "column": 58 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 77, - "column": 44 - }, - "end": { - "line": 77, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 5 - }, - "end": { - "line": 77, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 74, - "column": 22 - }, - "end": { - "line": 78, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface8", - "loc": { - "start": { - "line": 74, - "column": 11 - }, - "end": { - "line": 74, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 74, - "column": 1 - }, - "end": { - "line": 78, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 81, - "column": 5 - }, - "end": { - "line": 81, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 81, - "column": 8 - }, - "end": { - "line": 81, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 81, - "column": 8 - }, - "end": { - "line": 81, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 81, - "column": 5 - }, - "end": { - "line": 81, - "column": 11 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "string", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 82, - "column": 16 - }, - "end": { - "line": 82, - "column": 17 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 82, - "column": 19 - }, - "end": { - "line": 82, - "column": 25 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 82, - "column": 28 - }, - "end": { - "line": 82, - "column": 34 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "is", - "loc": { - "start": { - "line": 82, - "column": 37 - }, - "end": { - "line": 82, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 82, - "column": 37 - }, - "end": { - "line": 82, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 82, - "column": 19 - }, - "end": { - "line": 82, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 82, - "column": 16 - }, - "end": { - "line": 82, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 82, - "column": 14 - }, - "end": { - "line": 82, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 82, - "column": 6 - }, - "end": { - "line": 82, - "column": 12 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "TSThisType", - "loc": { - "start": { - "line": 82, - "column": 44 - }, - "end": { - "line": 82, - "column": 48 - } - } - }, - "typeAnnotation": { - "type": "TSThisType", - "loc": { - "start": { - "line": 82, - "column": 52 - }, - "end": { - "line": 82, - "column": 56 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 82, - "column": 44 - }, - "end": { - "line": 82, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 82, - "column": 5 - }, - "end": { - "line": 82, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 80, - "column": 22 - }, - "end": { - "line": 83, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Interface9", - "loc": { - "start": { - "line": 80, - "column": 11 - }, - "end": { - "line": 80, - "column": 21 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 80, - "column": 1 - }, - "end": { - "line": 83, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 83, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-type-predicate.ts b/es2panda/test/parser/ts/test-ts-type-predicate.ts deleted file mode 100644 index db5b78f8ea59a09b473cd1538d0aa359f37c353b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function function1(a: number | string): asserts a { return }; -var var1: (a: number | string) => asserts a; -interface Interface1 { - (a: number | string): asserts a; - (a: number | string): asserts this; -} - -function function2(asserts: number | string): asserts is number { return }; -var var2: (asserts: number | string) => asserts is number; -interface Interface2 { - a: number; - (asserts: number | string): asserts is number; - (asserts: { a: number | string }): asserts is this; -} - -function function3(is: number | string): is is number { return }; -var var3: (is: number | string) => is is number; -interface Interface3 { - a: number; - (is: number | string): is is number; - (is: { a: number | string }): is is this; -} - -function function4(a: number | string): a is number { return }; -var var4: (a: number | string) => a is number; -interface Interface4 { - a: number; - (a: number | string): a is number; - (a: { a: number | string }): a is this; -} - -function function5(a: number | string): asserts a is number { return }; -var var5: (a: number | string) => asserts a is number; -interface Interface5 { - a: number; - (a: number | string): asserts a is number; - (a: { a: number | string }): asserts a is this; -} - -function function6(asserts: number | string): asserts asserts is number { return }; -var var6: (asserts: number | string) => asserts asserts is number; -interface Interface6 { - a: number; - (asserts: number | string): asserts asserts is number; - (asserts: { a: number | string }): asserts asserts is this; -} - -type is = string | number | boolean; - -function function7(is: number | string | is): is is is { return }; -var var7: (is: number | string | is) => is is is; -interface Interface7 { - (is: number | string | is): is is is; -} - -function function8(string: number | string | is): string is number { return }; -var var8: (string: number | string | is) => string is number; -interface Interface8 { - a: is; - (string: number | string | is): string is number; - (string: { a: number | string | is }): string is this; -} - -interface Interface9 { - a: is; - (string: { a: number | string | is }): this is this; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-type-predicate1-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate1-expected.txt deleted file mode 100644 index d810c9b323b2b2b46762bbcf5fd14f2d0434de4d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate1-expected.txt +++ /dev/null @@ -1,188 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "function1", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "is", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 22 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "asserts", - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "return", - "loc": { - "start": { - "line": 17, - "column": 55 - }, - "end": { - "line": 17, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 55 - }, - "end": { - "line": 17, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 64 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 64 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-type-predicate1.ts b/es2panda/test/parser/ts/test-ts-type-predicate1.ts deleted file mode 100644 index ec4ca9acbc6964a21ac657238b4b3139f42f2918..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function function1(is: number | string): asserts is { return }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-type-predicate2-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate2-expected.txt deleted file mode 100644 index 56b08bb45c1abf0b540cc1c95f117daeaf42c57b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-ts-type-predicate2.ts:17:46] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate2.ts b/es2panda/test/parser/ts/test-ts-type-predicate2.ts deleted file mode 100644 index ea1686930770855d79a6404c42ebf909c77eed39..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var var1: (is: number | string) => asserts is; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-type-predicate3-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate3-expected.txt deleted file mode 100644 index 76f66d0b4a836daa65c7894b417c242fc1f358e9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-type-predicate3.ts:17:63] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate3.ts b/es2panda/test/parser/ts/test-ts-type-predicate3.ts deleted file mode 100644 index dae4c431d98203fb34c0de7b32792b4fef155635..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function function1(is: number | string): asserts is is number { return }; diff --git a/es2panda/test/parser/ts/test-ts-type-predicate4-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate4-expected.txt deleted file mode 100644 index 947c6e4cee64cfe620c31331844e5035a58071dc..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-type-predicate4.ts:17:50] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate4.ts b/es2panda/test/parser/ts/test-ts-type-predicate4.ts deleted file mode 100644 index 927e29e7beb40a327d9dee95141eb3ba8115ac85..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var var1: (is: number | string) => asserts is is number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-ts-type-predicate5-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate5-expected.txt deleted file mode 100644 index eed74e19a1a9c1bc667f5eeabe264f50aa014258..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-type-predicate5.ts:17:68] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate5.ts b/es2panda/test/parser/ts/test-ts-type-predicate5.ts deleted file mode 100644 index eaf51510a96daa9bfc028f3fe43b92caf2156346..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function function1(is: number | string): asserts (number | string) { return }; diff --git a/es2panda/test/parser/ts/test-ts-type-predicate6-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate6-expected.txt deleted file mode 100644 index 4582883c84afbf770890e0b4f2c414e365a6e58c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-type-predicate6.ts:17:44] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate6.ts b/es2panda/test/parser/ts/test-ts-type-predicate6.ts deleted file mode 100644 index bfbdbca439236f62f7edb65185c3c4f3d8ddcced..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var var1: (is: number | string) => asserts (number | string); diff --git a/es2panda/test/parser/ts/test-ts-type-predicate7-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate7-expected.txt deleted file mode 100644 index 19917b16f90495b68a9ef558f43e053b6484b0b4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-type-predicate7.ts:17:63] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate7.ts b/es2panda/test/parser/ts/test-ts-type-predicate7.ts deleted file mode 100644 index 15a6b8a0e8b8dfad4344373aad5b484c83c6724a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function function1(is: number | string): (number | string) is number { return }; diff --git a/es2panda/test/parser/ts/test-ts-type-predicate8-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate8-expected.txt deleted file mode 100644 index e0a83e82b439f0f4f7a2b973996e7333382b8dbe..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-ts-type-predicate8.ts:17:54] diff --git a/es2panda/test/parser/ts/test-ts-type-predicate8.ts b/es2panda/test/parser/ts/test-ts-type-predicate8.ts deleted file mode 100644 index 63aa16dc47e8acc915052edef115a92281572a09..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-type-predicate8.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var var1: (is: number | string) => (number | string) is number; diff --git a/es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt b/es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt deleted file mode 100644 index f6875baf9a7066ddf6d18751df1ab1c94fab8da6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-unique-symbol-type-expected.txt +++ /dev/null @@ -1,357 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "s2", - "typeAnnotation": { - "type": "TSTypeOperator", - "operator": "unique", - "typeAnnotation": { - "type": "TSSymbolKeyword", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "Symbol", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 36 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "SymbolClass", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "s2", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": true, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 22 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-ts-unique-symbol-type.ts b/es2panda/test/parser/ts/test-ts-unique-symbol-type.ts deleted file mode 100644 index f445074c8fd30fba9c1191f2bcd179c45cfa0548..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-ts-unique-symbol-type.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const s2 : unique symbol = Symbol(); -class SymbolClass{ - a : string = "a"; - [s2] : number = 2; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type-expected.txt b/es2panda/test/parser/ts/test-tuple-type-expected.txt deleted file mode 100644 index 8be9d2bab3e34cc843c8b631d89f80c377e7543a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type-expected.txt +++ /dev/null @@ -1,905 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "label": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "label": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 17, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, - "label": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 52 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "label": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "label": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 31 - } - } - }, - { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 19, - "column": 37 - }, - "end": { - "line": 19, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 34 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 47 - }, - "end": { - "line": 19, - "column": 54 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 56 - }, - "end": { - "line": 19, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 46 - }, - "end": { - "line": 19, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 43 - }, - "end": { - "line": 19, - "column": 44 - } - } - } - ], - "returnType": { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 19, - "column": 69 - }, - "end": { - "line": 19, - "column": 78 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 78 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 36 - }, - "end": { - "line": 20, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 43 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 45 - }, - "end": { - "line": 20, - "column": 51 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 53 - }, - "end": { - "line": 20, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 14 - } - } -} diff --git a/es2panda/test/parser/ts/test-tuple-type.ts b/es2panda/test/parser/ts/test-tuple-type.ts deleted file mode 100644 index 180ce4a82ef99b0a9a639ef2726c496ebbfc3ee8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: [a: number, b: string, c: (boolean | void)[]]; -var b: [string, string, string]; -var c: [[a: number, b: string], (a: void, b: [boolean, boolean]) => undefined] -var d: [[[number, number], number, number], number, number] -var e: [A] \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type1-expected.txt b/es2panda/test/parser/ts/test-tuple-type1-expected.txt deleted file mode 100644 index b4e644ec5804c3bc4598f810a6d8f07f4dfd4629..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ',' expected. [test-tuple-type1.ts:17:19] diff --git a/es2panda/test/parser/ts/test-tuple-type1.ts b/es2panda/test/parser/ts/test-tuple-type1.ts deleted file mode 100644 index 0a71d68b3f416f67561e4af3cff3605c46211a44..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: [a: number string] \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type10-expected.txt b/es2panda/test/parser/ts/test-tuple-type10-expected.txt deleted file mode 100644 index ccfeab7395b610a8aeca54749d021c914c7d08dd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type10-expected.txt +++ /dev/null @@ -1,206 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSRestType", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "S", - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - { - "type": "TSRestType", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 40 - }, - "end": { - "line": 17, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 40 - }, - "end": { - "line": 17, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "S", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "constraint": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 50 - } - } -} diff --git a/es2panda/test/parser/ts/test-tuple-type10.ts b/es2panda/test/parser/ts/test-tuple-type10.ts deleted file mode 100644 index 293cf935f43af7b63db46dd70d0d2a1964b7a5e2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type10.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type a = [...S, ...string[]]; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type2-expected.txt b/es2panda/test/parser/ts/test-tuple-type2-expected.txt deleted file mode 100644 index e2affa9688d0b86ab1901f75e6cd1fd9be883b86..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Tuple members must all have or haven't names [test-tuple-type2.ts:17:17] diff --git a/es2panda/test/parser/ts/test-tuple-type2.ts b/es2panda/test/parser/ts/test-tuple-type2.ts deleted file mode 100644 index 17dcf7109de2bc7c9a9f806767d3dbbc5d84b09a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: [number, a: string] \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type3-expected.txt b/es2panda/test/parser/ts/test-tuple-type3-expected.txt deleted file mode 100644 index 2710c09bf550122e87f42a53218e9a92a2ad9deb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-tuple-type3.ts:17:9] diff --git a/es2panda/test/parser/ts/test-tuple-type3.ts b/es2panda/test/parser/ts/test-tuple-type3.ts deleted file mode 100644 index e4af3e32fb7343bb74b435ef4f200cb1396503f5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: [?number] \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type4-expected.txt b/es2panda/test/parser/ts/test-tuple-type4-expected.txt deleted file mode 100644 index 2f7fbeb1b2d7c5f5d38b4c0ca8d8281aea25b113..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A required element cannot follow an optional element [test-tuple-type4.ts:17:22] diff --git a/es2panda/test/parser/ts/test-tuple-type4.ts b/es2panda/test/parser/ts/test-tuple-type4.ts deleted file mode 100644 index 8afce7388f7b6b98d6b63fba1e2bcd0ea8653d17..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: [a?: number, b: string] \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type5-expected.txt b/es2panda/test/parser/ts/test-tuple-type5-expected.txt deleted file mode 100644 index 3e039e2c57780493eb9af895976b4efe41a86c7c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type5-expected.txt +++ /dev/null @@ -1,1660 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x1", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x2", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "TSRestType", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x3", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "label": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "label": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, - "rest": true, - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 44 - }, - "end": { - "line": 19, - "column": 50 - } - } - }, - "label": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 19, - "column": 40 - }, - "end": { - "line": 19, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 40 - }, - "end": { - "line": 19, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 52 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x4", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - { - "type": "TSOptionalType", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 28 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x5", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "label": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 21, - "column": 34 - } - } - }, - "label": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 36 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ForTupleTest", - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x6", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ForTupleTest", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - { - "type": "TSOptionalType", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ForTupleTest", - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 40 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x7", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 21 - } - } - }, - "label": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 21 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ForTupleTest", - "loc": { - "start": { - "line": 26, - "column": 28 - }, - "end": { - "line": 26, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 28 - }, - "end": { - "line": 26, - "column": 40 - } - } - }, - "label": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 23 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 26, - "column": 23 - }, - "end": { - "line": 26, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 42 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x8", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 27, - "column": 11 - }, - "end": { - "line": 27, - "column": 17 - } - } - }, - { - "type": "TSRestType", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ForTupleTest", - "loc": { - "start": { - "line": 27, - "column": 22 - }, - "end": { - "line": 27, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 22 - }, - "end": { - "line": 27, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 22 - }, - "end": { - "line": 27, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 36 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 38 - }, - "end": { - "line": 27, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 46 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x9", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "label": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSArrayType", - "elementType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 28, - "column": 30 - }, - "end": { - "line": 28, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 30 - }, - "end": { - "line": 28, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 30 - }, - "end": { - "line": 28, - "column": 33 - } - } - }, - "label": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 28, - "column": 26 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - "rest": true, - "loc": { - "start": { - "line": 28, - "column": 23 - }, - "end": { - "line": 28, - "column": 33 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 28, - "column": 37 - }, - "end": { - "line": 28, - "column": 43 - } - } - }, - "label": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 28, - "column": 35 - }, - "end": { - "line": 28, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 35 - }, - "end": { - "line": 28, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 28, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 7 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 45 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "StringsForTupleTest", - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 25 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 30, - "column": 29 - }, - "end": { - "line": 30, - "column": 35 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 30, - "column": 37 - }, - "end": { - "line": 30, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 28 - }, - "end": { - "line": 30, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 31, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "NumbersForTupleTest", - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 29 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 37 - }, - "end": { - "line": 31, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 28 - }, - "end": { - "line": 31, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 32, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "x10", - "loc": { - "start": { - "line": 32, - "column": 6 - }, - "end": { - "line": 32, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSRestType", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "StringsForTupleTest", - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 32, - "column": 35 - } - } - }, - { - "type": "TSRestType", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "NumbersForTupleTest", - "loc": { - "start": { - "line": 32, - "column": 40 - }, - "end": { - "line": 32, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 40 - }, - "end": { - "line": 32, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 37 - }, - "end": { - "line": 32, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 12 - }, - "end": { - "line": 32, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 33, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 33, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-tuple-type5.ts b/es2panda/test/parser/ts/test-tuple-type5.ts deleted file mode 100644 index 9fa1dd44329366fcc2a4cf38abb8462c65be6129..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type5.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var x1 : [number, string]; -var x2 : [string, ...number[], string]; -var x3 : [a : boolean, ...b :string[], c : number]; -var x4 : [string, number?]; -var x5 : [a : number, b ?: string]; - -class ForTupleTest { -} -var x6 : [ForTupleTest, ForTupleTest?]; -var x7 : [a : number, b ?: ForTupleTest]; -var x8 : [number, ...ForTupleTest[], string]; -var x9 : [a : string, ...b : C[], c:string]; - -type StringsForTupleTest = [string, string] -type NumbersForTupleTest = [number, number] -type x10 = [...StringsForTupleTest, ...NumbersForTupleTest] diff --git a/es2panda/test/parser/ts/test-tuple-type6-expected.txt b/es2panda/test/parser/ts/test-tuple-type6-expected.txt deleted file mode 100644 index bb95e522b65c8ca9d6a1935c8b02b8a68e92f828..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type6-expected.txt +++ /dev/null @@ -1,192 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "WithOptAndRest", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "label": { - "type": "Identifier", - "name": "first", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 48 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - "label": { - "type": "Identifier", - "name": "second", - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 45 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - { - "type": "TSNamedTupleMember", - "elementType": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 65 - }, - "end": { - "line": 17, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 65 - }, - "end": { - "line": 17, - "column": 73 - } - } - }, - "label": { - "type": "Identifier", - "name": "rest", - "loc": { - "start": { - "line": 17, - "column": 59 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, - "rest": true, - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 73 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 75 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 75 - } - } -} diff --git a/es2panda/test/parser/ts/test-tuple-type6.ts b/es2panda/test/parser/ts/test-tuple-type6.ts deleted file mode 100644 index a7883e92fce93c30427b6e887a6fa1e2640a4359..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type WithOptAndRest = [first: number, second?: number, ...rest: string[]]; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type7-expected.txt b/es2panda/test/parser/ts/test-tuple-type7-expected.txt deleted file mode 100644 index 01ff5953ca50db5e3ef0fa5b09435589bdce90a1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A rest element cannot follow another rest element [test-tuple-type7.ts:17:78] diff --git a/es2panda/test/parser/ts/test-tuple-type7.ts b/es2panda/test/parser/ts/test-tuple-type7.ts deleted file mode 100644 index 33417a6b9d302c89206cf7a91542fa6fdb4546fa..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type7.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type WithMutipleRest = [first: number, ...rest1: string[], ...rest2: string[]]; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type8-expected.txt b/es2panda/test/parser/ts/test-tuple-type8-expected.txt deleted file mode 100644 index 4d9d3bfe297b36d11c0979f2bbe630d6e85b72d1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A rest element cannot follow another rest element [test-tuple-type8.ts:17:50] diff --git a/es2panda/test/parser/ts/test-tuple-type8.ts b/es2panda/test/parser/ts/test-tuple-type8.ts deleted file mode 100644 index 1d2c7bd83c8d6df99da7af5ee2836db32c6034d3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type8.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type WithMutipleRest2 = [...number[], ...string[]]; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-tuple-type9-expected.txt b/es2panda/test/parser/ts/test-tuple-type9-expected.txt deleted file mode 100644 index e58c43148343fd04904446a48a33b5a9d47d3ada..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A required element cannot follow an optional element [test-tuple-type9.ts:18:50] diff --git a/es2panda/test/parser/ts/test-tuple-type9.ts b/es2panda/test/parser/ts/test-tuple-type9.ts deleted file mode 100644 index 27a1d3676a1be61dc12d30b53bc047a1d0f80da5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-tuple-type9.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type WithOptAndRest1 = [number, number?, ...string[]]; -type WithOptAndRest2 = [number, number?, string[]]; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-alias-expected.txt b/es2panda/test/parser/ts/test-type-alias-expected.txt deleted file mode 100644 index feb584db18590187eaac79a5e693724444fd45e4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias-expected.txt +++ /dev/null @@ -1,453 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 34 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 32 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 51 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "baz", - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 12 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-alias.ts b/es2panda/test/parser/ts/test-type-alias.ts deleted file mode 100644 index 491accecbedb3ca10178cebadf577530e4777b25..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type foo = number | string; -type bar = foo | ((a: number, b: string) => void); -type baz = foo | bar[] | number[]; -var a: baz; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-alias1-expected.txt b/es2panda/test/parser/ts/test-type-alias1-expected.txt deleted file mode 100644 index ef3046876dfd6a633da2682f4259a3c2b2c54f1a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token [test-type-alias1.ts:17:6] diff --git a/es2panda/test/parser/ts/test-type-alias1.ts b/es2panda/test/parser/ts/test-type-alias1.ts deleted file mode 100644 index d2b61be22fa996471f5780ede20912248bb8ee77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type 5 = number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-alias2-expected.txt b/es2panda/test/parser/ts/test-type-alias2-expected.txt deleted file mode 100644 index 56e208aaa39fe2cf11f03c4bd6746fef6fd58918..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: '=' expected [test-type-alias2.ts:17:10] diff --git a/es2panda/test/parser/ts/test-type-alias2.ts b/es2panda/test/parser/ts/test-type-alias2.ts deleted file mode 100644 index 5493c3688337029601f7c18a97f0bdfea8d79ad3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type bar number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-alias3-expected.txt b/es2panda/test/parser/ts/test-type-alias3-expected.txt deleted file mode 100644 index 547ff6839ae535c8da0a3797919ec809908ac2ad..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test-type-alias3.ts:17:12] diff --git a/es2panda/test/parser/ts/test-type-alias3.ts b/es2panda/test/parser/ts/test-type-alias3.ts deleted file mode 100644 index 300647141376ac827be1e9f799aa85c11a45ba9d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-alias3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type foo = ; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-annotation-expected.txt b/es2panda/test/parser/ts/test-type-annotation-expected.txt deleted file mode 100644 index ae0948e8ed45c6ff64e8342579a15292f6672e9a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-annotation-expected.txt +++ /dev/null @@ -1,4029 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 13 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "TSNullKeyword", - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "g", - "typeAnnotation": { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "h", - "typeAnnotation": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 25, - "column": 8 - }, - "end": { - "line": 25, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "i", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 26, - "column": 8 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "j", - "typeAnnotation": { - "type": "TSBigIntKeyword", - "loc": { - "start": { - "line": 27, - "column": 8 - }, - "end": { - "line": 27, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "k", - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 28, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 15 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "l", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 31, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 17 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "m", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 32, - "column": 8 - }, - "end": { - "line": 32, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 8 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 8 - }, - "end": { - "line": 32, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 32, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 19 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "n", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 33, - "column": 8 - }, - "end": { - "line": 33, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 8 - }, - "end": { - "line": 33, - "column": 17 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSLiteralType", - "literal": { - "type": "BigIntLiteral", - "value": "5n", - "loc": { - "start": { - "line": 33, - "column": 20 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 20 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 20 - }, - "end": { - "line": 33, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 8 - }, - "end": { - "line": 33, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 25 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "o", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 36, - "column": 18 - }, - "end": { - "line": 36, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 27 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 36, - "column": 30 - }, - "end": { - "line": 36, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 30 - }, - "end": { - "line": 36, - "column": 34 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 36, - "column": 39 - }, - "end": { - "line": 36, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 39 - }, - "end": { - "line": 36, - "column": 50 - } - } - }, - { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 36, - "column": 53 - }, - "end": { - "line": 36, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 39 - }, - "end": { - "line": 36, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 38 - }, - "end": { - "line": 36, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 38 - }, - "end": { - "line": 36, - "column": 63 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 36, - "column": 66 - }, - "end": { - "line": 36, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 66 - }, - "end": { - "line": 36, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 38 - }, - "end": { - "line": 36, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 37 - }, - "end": { - "line": 36, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 37 - }, - "end": { - "line": 36, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 36, - "column": 75 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "p", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 15 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 37, - "column": 18 - }, - "end": { - "line": 37, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 8 - }, - "end": { - "line": 37, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 8 - }, - "end": { - "line": 37, - "column": 27 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 37, - "column": 31 - }, - "end": { - "line": 37, - "column": 37 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 37, - "column": 40 - }, - "end": { - "line": 37, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 31 - }, - "end": { - "line": 37, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 30 - }, - "end": { - "line": 37, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 30 - }, - "end": { - "line": 37, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 8 - }, - "end": { - "line": 37, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 37, - "column": 1 - }, - "end": { - "line": 37, - "column": 50 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "q", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 10 - }, - "end": { - "line": 38, - "column": 16 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 19 - }, - "end": { - "line": 38, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 10 - }, - "end": { - "line": 38, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 28 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 32 - }, - "end": { - "line": 38, - "column": 38 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 41 - }, - "end": { - "line": 38, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 32 - }, - "end": { - "line": 38, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 31 - }, - "end": { - "line": 38, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 31 - }, - "end": { - "line": 38, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 8 - }, - "end": { - "line": 38, - "column": 51 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 38, - "column": 54 - }, - "end": { - "line": 38, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 8 - }, - "end": { - "line": 38, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 38, - "column": 1 - }, - "end": { - "line": 38, - "column": 61 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "r", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 41, - "column": 12 - }, - "end": { - "line": 41, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 11 - }, - "end": { - "line": 41, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 10 - }, - "end": { - "line": 41, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 9 - }, - "end": { - "line": 41, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 8 - }, - "end": { - "line": 41, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 8 - }, - "end": { - "line": 41, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 41, - "column": 1 - }, - "end": { - "line": 41, - "column": 25 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 42, - "column": 10 - }, - "end": { - "line": 42, - "column": 16 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 42, - "column": 19 - }, - "end": { - "line": 42, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 10 - }, - "end": { - "line": 42, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 27 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 42, - "column": 31 - }, - "end": { - "line": 42, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 31 - }, - "end": { - "line": 42, - "column": 32 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 42, - "column": 35 - }, - "end": { - "line": 42, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 35 - }, - "end": { - "line": 42, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 31 - }, - "end": { - "line": 42, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 30 - }, - "end": { - "line": 42, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 8 - }, - "end": { - "line": 42, - "column": 41 - } - } - }, - { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 42, - "column": 45 - }, - "end": { - "line": 42, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 44 - }, - "end": { - "line": 42, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 8 - }, - "end": { - "line": 42, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 42, - "column": 51 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "func1", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 45, - "column": 16 - }, - "end": { - "line": 45, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 13 - }, - "end": { - "line": 45, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 45, - "column": 27 - }, - "end": { - "line": 45, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 24 - }, - "end": { - "line": 45, - "column": 25 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 45, - "column": 38 - }, - "end": { - "line": 45, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 12 - }, - "end": { - "line": 45, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 45, - "column": 1 - }, - "end": { - "line": 45, - "column": 45 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "func2", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 46, - "column": 16 - }, - "end": { - "line": 46, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 16 - }, - "end": { - "line": 46, - "column": 24 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 46, - "column": 27 - }, - "end": { - "line": 46, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 16 - }, - "end": { - "line": 46, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 13 - }, - "end": { - "line": 46, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 46, - "column": 39 - }, - "end": { - "line": 46, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 39 - }, - "end": { - "line": 46, - "column": 40 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 46, - "column": 35 - }, - "end": { - "line": 46, - "column": 36 - } - } - } - ], - "returnType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 46, - "column": 45 - }, - "end": { - "line": 46, - "column": 51 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 46, - "column": 54 - }, - "end": { - "line": 46, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 45 - }, - "end": { - "line": 46, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 12 - }, - "end": { - "line": 46, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 5 - }, - "end": { - "line": 46, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 46, - "column": 5 - }, - "end": { - "line": 46, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 46, - "column": 1 - }, - "end": { - "line": 46, - "column": 61 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "func3", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 47, - "column": 20 - }, - "end": { - "line": 47, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 17 - }, - "end": { - "line": 47, - "column": 18 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 47, - "column": 31 - }, - "end": { - "line": 47, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 28 - }, - "end": { - "line": 47, - "column": 29 - } - } - } - ], - "returnType": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 47, - "column": 42 - }, - "end": { - "line": 47, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 42 - }, - "end": { - "line": 47, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 16 - }, - "end": { - "line": 47, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 13 - }, - "end": { - "line": 47, - "column": 14 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 47, - "column": 53 - }, - "end": { - "line": 47, - "column": 54 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 47, - "column": 56 - }, - "end": { - "line": 47, - "column": 57 - } - } - } - ], - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 47, - "column": 60 - }, - "end": { - "line": 47, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 60 - }, - "end": { - "line": 47, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 52 - }, - "end": { - "line": 47, - "column": 58 - } - } - } - ], - "returnType": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 47, - "column": 77 - }, - "end": { - "line": 47, - "column": 83 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 74 - }, - "end": { - "line": 47, - "column": 75 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 47, - "column": 88 - }, - "end": { - "line": 47, - "column": 95 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 85 - }, - "end": { - "line": 47, - "column": 86 - } - } - } - ], - "returnType": { - "type": "TSLiteralType", - "literal": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 47, - "column": 100 - }, - "end": { - "line": 47, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 100 - }, - "end": { - "line": 47, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 73 - }, - "end": { - "line": 47, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 12 - }, - "end": { - "line": 47, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 47, - "column": 1 - }, - "end": { - "line": 47, - "column": 105 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ctor1", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 50, - "column": 20 - }, - "end": { - "line": 50, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 17 - }, - "end": { - "line": 50, - "column": 18 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 50, - "column": 31 - }, - "end": { - "line": 50, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 28 - }, - "end": { - "line": 50, - "column": 29 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 50, - "column": 42 - }, - "end": { - "line": 50, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 12 - }, - "end": { - "line": 50, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 5 - }, - "end": { - "line": 50, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 50, - "column": 5 - }, - "end": { - "line": 50, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 50, - "column": 1 - }, - "end": { - "line": 50, - "column": 49 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ctor2", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 51, - "column": 20 - }, - "end": { - "line": 51, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 20 - }, - "end": { - "line": 51, - "column": 28 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 51, - "column": 31 - }, - "end": { - "line": 51, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 51, - "column": 20 - }, - "end": { - "line": 51, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 17 - }, - "end": { - "line": 51, - "column": 18 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 51, - "column": 43 - }, - "end": { - "line": 51, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 43 - }, - "end": { - "line": 51, - "column": 44 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 51, - "column": 39 - }, - "end": { - "line": 51, - "column": 40 - } - } - } - ], - "returnType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 51, - "column": 49 - }, - "end": { - "line": 51, - "column": 55 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 51, - "column": 58 - }, - "end": { - "line": 51, - "column": 64 - } - } - } - ], - "loc": { - "start": { - "line": 51, - "column": 49 - }, - "end": { - "line": 51, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 12 - }, - "end": { - "line": 51, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 5 - }, - "end": { - "line": 51, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 51, - "column": 5 - }, - "end": { - "line": 51, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 51, - "column": 1 - }, - "end": { - "line": 51, - "column": 65 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ctor3", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 52, - "column": 24 - }, - "end": { - "line": 52, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 21 - }, - "end": { - "line": 52, - "column": 22 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 52, - "column": 35 - }, - "end": { - "line": 52, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 32 - }, - "end": { - "line": 52, - "column": 33 - } - } - } - ], - "returnType": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 52, - "column": 46 - }, - "end": { - "line": 52, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 46 - }, - "end": { - "line": 52, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 20 - }, - "end": { - "line": 52, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 17 - }, - "end": { - "line": 52, - "column": 18 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 52, - "column": 57 - }, - "end": { - "line": 52, - "column": 58 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 52, - "column": 60 - }, - "end": { - "line": 52, - "column": 61 - } - } - } - ], - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 52, - "column": 64 - }, - "end": { - "line": 52, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 64 - }, - "end": { - "line": 52, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 56 - }, - "end": { - "line": 52, - "column": 62 - } - } - } - ], - "returnType": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 52, - "column": 81 - }, - "end": { - "line": 52, - "column": 87 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 78 - }, - "end": { - "line": 52, - "column": 79 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 52, - "column": 92 - }, - "end": { - "line": 52, - "column": 99 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 89 - }, - "end": { - "line": 52, - "column": 90 - } - } - } - ], - "returnType": { - "type": "TSLiteralType", - "literal": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 52, - "column": 104 - }, - "end": { - "line": 52, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 104 - }, - "end": { - "line": 52, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 77 - }, - "end": { - "line": 52, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 12 - }, - "end": { - "line": 52, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 5 - }, - "end": { - "line": 52, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 52, - "column": 5 - }, - "end": { - "line": 52, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 52, - "column": 1 - }, - "end": { - "line": 52, - "column": 109 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ctor4", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 53, - "column": 29 - }, - "end": { - "line": 53, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 26 - }, - "end": { - "line": 53, - "column": 27 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 53, - "column": 40 - }, - "end": { - "line": 53, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 37 - }, - "end": { - "line": 53, - "column": 38 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 53, - "column": 51 - }, - "end": { - "line": 53, - "column": 57 - } - } - }, - "abstract": true, - "loc": { - "start": { - "line": 53, - "column": 12 - }, - "end": { - "line": 53, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 5 - }, - "end": { - "line": 53, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 53, - "column": 5 - }, - "end": { - "line": 53, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 53, - "column": 1 - }, - "end": { - "line": 53, - "column": 58 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ctor5", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 54, - "column": 29 - }, - "end": { - "line": 54, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 29 - }, - "end": { - "line": 54, - "column": 37 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 54, - "column": 40 - }, - "end": { - "line": 54, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 54, - "column": 29 - }, - "end": { - "line": 54, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 26 - }, - "end": { - "line": 54, - "column": 27 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 54, - "column": 52 - }, - "end": { - "line": 54, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 52 - }, - "end": { - "line": 54, - "column": 53 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 54, - "column": 48 - }, - "end": { - "line": 54, - "column": 49 - } - } - } - ], - "returnType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 54, - "column": 58 - }, - "end": { - "line": 54, - "column": 64 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 54, - "column": 67 - }, - "end": { - "line": 54, - "column": 73 - } - } - } - ], - "loc": { - "start": { - "line": 54, - "column": 58 - }, - "end": { - "line": 54, - "column": 73 - } - } - }, - "abstract": true, - "loc": { - "start": { - "line": 54, - "column": 12 - }, - "end": { - "line": 54, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 5 - }, - "end": { - "line": 54, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 54, - "column": 5 - }, - "end": { - "line": 54, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 54, - "column": 1 - }, - "end": { - "line": 54, - "column": 74 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ctor6", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 55, - "column": 33 - }, - "end": { - "line": 55, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 30 - }, - "end": { - "line": 55, - "column": 31 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 55, - "column": 44 - }, - "end": { - "line": 55, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 41 - }, - "end": { - "line": 55, - "column": 42 - } - } - } - ], - "returnType": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 55, - "column": 55 - }, - "end": { - "line": 55, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 55 - }, - "end": { - "line": 55, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 29 - }, - "end": { - "line": 55, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 26 - }, - "end": { - "line": 55, - "column": 27 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 55, - "column": 66 - }, - "end": { - "line": 55, - "column": 67 - } - } - }, - { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 55, - "column": 69 - }, - "end": { - "line": 55, - "column": 70 - } - } - } - ], - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 55, - "column": 73 - }, - "end": { - "line": 55, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 73 - }, - "end": { - "line": 55, - "column": 81 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 65 - }, - "end": { - "line": 55, - "column": 71 - } - } - } - ], - "returnType": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 55, - "column": 90 - }, - "end": { - "line": 55, - "column": 96 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 87 - }, - "end": { - "line": 55, - "column": 88 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 55, - "column": 101 - }, - "end": { - "line": 55, - "column": 108 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 98 - }, - "end": { - "line": 55, - "column": 99 - } - } - } - ], - "returnType": { - "type": "TSLiteralType", - "literal": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 55, - "column": 113 - }, - "end": { - "line": 55, - "column": 117 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 113 - }, - "end": { - "line": 55, - "column": 117 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 86 - }, - "end": { - "line": 55, - "column": 117 - } - } - }, - "abstract": true, - "loc": { - "start": { - "line": 55, - "column": 12 - }, - "end": { - "line": 55, - "column": 117 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 5 - }, - "end": { - "line": 55, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 55, - "column": 5 - }, - "end": { - "line": 55, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 55, - "column": 1 - }, - "end": { - "line": 55, - "column": 118 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 55, - "column": 118 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-annotation.ts b/es2panda/test/parser/ts/test-type-annotation.ts deleted file mode 100644 index 42d34c24d0c24ac0f885fccc703bb88cfb037c36..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-annotation.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// Test basic types -var a: number; -var b: string; -var c: boolean; -var d: void; -var e: null; -var f: undefined; -var g: unknown; -var h: never; -var i: any; -var j: bigint; -var k: object; - -// Test array type -var l: number[]; -var m: string[][]; -var n: unknown[] | 5n[]; - -// Test union type -var o: (number | string)[] | true | ((undefined[] | unknown)[] | "foo")[]; -var p: (number | string)[] | (number | string)[]; -var q: ((number | number)[] | (number | number)[]) | string; - -// Test parenthesized type -var r: ((((number))))[]; -var s: ((string | boolean) | (5 | true)) | (void); - -// Test function type -var func1: (a: number, b: string) => number; -var func2: (a: number[] | string, b?: 5) => number | string; -var func3: (f: (a: number, b: string) => number[], [a, b]: number[]) => (a: number, b: boolean) => true; - -// Test constructor type -var ctor1: new (a: number, b: string) => number; -var ctor2: new (a: number[] | string, b?: 5) => number | string; -var ctor3: new (f: (a: number, b: string) => number[], [a, b]: number[]) => (a: number, b: boolean) => true; -var ctor4: abstract new (a: number, b: string) => number; -var ctor5: abstract new (a: number[] | string, b?: 5) => number | string; -var ctor6: abstract new (f: (a: number, b: string) => number[], [a, b]: number[]) => (a: number, b: boolean) => true; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-annotation1-expected.txt b/es2panda/test/parser/ts/test-type-annotation1-expected.txt deleted file mode 100644 index 7f11a57a7319f4725eef2ca3e1aa70320beb2b36..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-annotation1-expected.txt +++ /dev/null @@ -1,226 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeOperator", - "operator": "readonly", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "TSNullKeyword", - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - { - "type": "TSNullKeyword", - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-annotation1.ts b/es2panda/test/parser/ts/test-type-annotation1.ts deleted file mode 100644 index 86cbfe0b863aeb081a3a72f6b0dacfdf204a69c9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-annotation1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// Test types with special keywords -let a : readonly any[] | null -let b : keyof any | null - diff --git a/es2panda/test/parser/ts/test-type-annotation2-expected.txt b/es2panda/test/parser/ts/test-type-annotation2-expected.txt deleted file mode 100644 index 7c5e6d02403d5c1d73497579d6df9a572820ad83..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-annotation2-expected.txt +++ /dev/null @@ -1,379 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "members": [ - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "TSEnumMember", - "id": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "const": false, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "property": { - "type": "Identifier", - "name": "false", - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 26 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "right": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - "property": { - "type": "Identifier", - "name": "true", - "loc": { - "start": { - "line": 22, - "column": 20 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 24 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-annotation2.ts b/es2panda/test/parser/ts/test-type-annotation2.ts deleted file mode 100644 index a38984061dae0a1b12ab8c1fe7a8963fea2aac07..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-annotation2.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -enum E{ - false, - true -} -var a : E.false = E.false -var b : E.true = E.true - diff --git a/es2panda/test/parser/ts/test-type-assertion-followedby-another-expr-expected.txt b/es2panda/test/parser/ts/test-type-assertion-followedby-another-expr-expected.txt deleted file mode 100644 index 044dc74615a51dfe9868c9eeeae977a42332d23c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-assertion-followedby-another-expr-expected.txt +++ /dev/null @@ -1,337 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "expression": { - "type": "UnaryExpression", - "operator": "+", - "prefix": true, - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 24 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "right": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "right": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 27 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 28 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-assertion-followedby-another-expr.ts b/es2panda/test/parser/ts/test-type-assertion-followedby-another-expr.ts deleted file mode 100644 index aee4445e70d0a13224717741b9db510d7851b8d2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-assertion-followedby-another-expr.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -let a = 2; -let b = +a + 2; -let c = 1 + a + b; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-literal-expected.txt b/es2panda/test/parser/ts/test-type-literal-expected.txt deleted file mode 100644 index dd292dbaedebb77c049dad1cbb8022afdfc4bb07..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal-expected.txt +++ /dev/null @@ -1,992 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSConstructSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 17, - "column": 46 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 48 - }, - "end": { - "line": 17, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 45 - }, - "end": { - "line": 17, - "column": 55 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": true, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 57 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 59 - }, - "end": { - "line": 17, - "column": 60 - } - } - }, - { - "type": "ArrayPattern", - "elements": [ - { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 17, - "column": 63 - }, - "end": { - "line": 17, - "column": 64 - } - } - }, - { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 17, - "column": 66 - }, - "end": { - "line": 17, - "column": 67 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 62 - }, - "end": { - "line": 17, - "column": 68 - } - } - }, - { - "type": "Identifier", - "name": "k", - "optional": true, - "loc": { - "start": { - "line": 17, - "column": 70 - }, - "end": { - "line": 17, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 75 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": true, - "readonly": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 36 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 41 - }, - "end": { - "line": 19, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 51 - } - } - } - ], - "returnType": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "g", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 58 - }, - "end": { - "line": 19, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 55 - }, - "end": { - "line": 19, - "column": 56 - } - } - }, - { - "type": "Identifier", - "name": "l", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 69 - }, - "end": { - "line": 19, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 66 - }, - "end": { - "line": 19, - "column": 67 - } - } - } - ], - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 80 - }, - "end": { - "line": 19, - "column": 86 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 54 - }, - "end": { - "line": 19, - "column": 86 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 37 - }, - "end": { - "line": 19, - "column": 88 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 88 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": true, - "optional": false, - "readonly": false, - "key": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - { - "type": "TSMethodSignature", - "computed": true, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 32 - }, - "end": { - "line": 20, - "column": 33 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 20, - "column": 50 - }, - "end": { - "line": 20, - "column": 53 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 20, - "column": 46 - }, - "end": { - "line": 20, - "column": 47 - } - } - } - ], - "typeAnnotation": { - "type": "TSNullKeyword", - "loc": { - "start": { - "line": 20, - "column": 56 - }, - "end": { - "line": 20, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 62 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-literal.ts b/es2panda/test/parser/ts/test-type-literal.ts deleted file mode 100644 index 0146d36ac67dcd3aa53697ee07c45e9c5b8aa07a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: { new(a: number, b: string): number; a: string; b?(a, [c, d], k?) } -var b: { a: number, b: number; c?: string } -var c: { a(a: number, b: string[]), (d: boolean, e): (g: number, l: string) => string } -var d: { ["foo"]: boolean, [5](a: undefined, b?: any): null } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-literal1-expected.txt b/es2panda/test/parser/ts/test-type-literal1-expected.txt deleted file mode 100644 index 297e75f7da3d56771b75ecc51cc85f1089420be8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ']' expected [test-type-literal1.ts:17:13] diff --git a/es2panda/test/parser/ts/test-type-literal1.ts b/es2panda/test/parser/ts/test-type-literal1.ts deleted file mode 100644 index 5a42274690126ea639ef64ca2c9be3b01dfb1782..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: { [a } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-literal2-expected.txt b/es2panda/test/parser/ts/test-type-literal2-expected.txt deleted file mode 100644 index c82a22f467a151079e04460ddb4638a0dd00710f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ',' expected [test-type-literal2.ts:17:14] diff --git a/es2panda/test/parser/ts/test-type-literal2.ts b/es2panda/test/parser/ts/test-type-literal2.ts deleted file mode 100644 index 449ac6fdf87c9f9deb192a820aa4745323cecbef..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: { new a()} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-literal3-expected.txt b/es2panda/test/parser/ts/test-type-literal3-expected.txt deleted file mode 100644 index 0ab239b6a7f1be58d66e9ef9d340143ae5978425..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ',' expected [test-type-literal3.ts:17:12] diff --git a/es2panda/test/parser/ts/test-type-literal3.ts b/es2panda/test/parser/ts/test-type-literal3.ts deleted file mode 100644 index 19d6c9de3348b3b7120f27295cd671f44f60e25a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-literal3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: { a new ()} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-query-expected.txt b/es2panda/test/parser/ts/test-type-query-expected.txt deleted file mode 100644 index 332aac860690b253ddcf262cecfcd7f9240e9f01..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query-expected.txt +++ /dev/null @@ -1,584 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "o", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "right": { - "type": "Identifier", - "name": "o", - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 28 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 21 - } - } - } - ], - "returnType": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 21, - "column": 41 - }, - "end": { - "line": 21, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 43 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-query.ts b/es2panda/test/parser/ts/test-type-query.ts deleted file mode 100644 index f4ec555d852703835adfd9c523d0517f0d51b28e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: number -var b: typeof a; -var c: { o: { k: typeof c.o } }; -var d: typeof c | typeof a; -var e: (a: number, b: string) => typeof d; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-query1-expected.txt b/es2panda/test/parser/ts/test-type-query1-expected.txt deleted file mode 100644 index 4e10024ee15af048e9598c1a9ff3c2990c72f1a5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Identifier expected. [test-type-query1.ts:17:15] diff --git a/es2panda/test/parser/ts/test-type-query1.ts b/es2panda/test/parser/ts/test-type-query1.ts deleted file mode 100644 index c35ac32fb84fa55a0233c7daf1ea33f586ae8379..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: typeof 5; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-query2-expected.txt b/es2panda/test/parser/ts/test-type-query2-expected.txt deleted file mode 100644 index bb6b1d79059308a7de5861ad1fdab75a8d4a6c19..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Identifier expected. [test-type-query2.ts:17:14] diff --git a/es2panda/test/parser/ts/test-type-query2.ts b/es2panda/test/parser/ts/test-type-query2.ts deleted file mode 100644 index 777da8bd08165e7839c1513415a52214132a2544..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: typeof \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-query3-expected.txt b/es2panda/test/parser/ts/test-type-query3-expected.txt deleted file mode 100644 index f5bf4d94c00cec3940fa0a908a9d8c47f7ba4d4d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query3-expected.txt +++ /dev/null @@ -1,198 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSCallSignatureDeclaration", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - } - ], - "returnType": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - { - "type": "TSCallSignatureDeclaration", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Example", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-query3.ts b/es2panda/test/parser/ts/test-type-query3.ts deleted file mode 100644 index bebaea4d378d637ee204a8b59817979e6be69a95..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-query3.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Example { - (a: number): typeof a - - (): void -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-template-literal1-expected.txt b/es2panda/test/parser/ts/test-type-template-literal1-expected.txt deleted file mode 100644 index 6892189ab0f7eb7ac142143f98483fe1f24be0d1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-template-literal1-expected.txt +++ /dev/null @@ -1,174 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "weather", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "sunny", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "report", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "weather", - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 34 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "Today is ", - "cooked": "Today is " - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 18, - "column": 35 - }, - "end": { - "line": 18, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-template-literal1.ts b/es2panda/test/parser/ts/test-type-template-literal1.ts deleted file mode 100644 index 0f102757290aa21b52245aba8eb147a8da4b05d9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-template-literal1.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type weather = "sunny"; -type report = `Today is ${weather}`; diff --git a/es2panda/test/parser/ts/test-type-template-literal2-expected.txt b/es2panda/test/parser/ts/test-type-template-literal2-expected.txt deleted file mode 100644 index ed5e75b29c762f6a9c738e283598f1a4a814683e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-template-literal2-expected.txt +++ /dev/null @@ -1,494 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "axis1", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "x", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "y", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "axis2", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "node", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "axis1", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "axis2", - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "num", - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 36 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "_", - "cooked": "_" - }, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 20, - "column": 37 - }, - "end": { - "line": 20, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-template-literal2.ts b/es2panda/test/parser/ts/test-type-template-literal2.ts deleted file mode 100644 index 4331cffd0129d784e3469a5d1a1da4463c9986b6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-template-literal2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type axis1 = "x" | "y"; -type axis2 = "a" | "b"; -type num = 1 | 2; -type node = `${axis1 | axis2}_${num}`; diff --git a/es2panda/test/parser/ts/test-type-template-literal3-expected.txt b/es2panda/test/parser/ts/test-type-template-literal3-expected.txt deleted file mode 100644 index e191cbb4eb6fbdb7469af0525a98f4ebda0d81c5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-template-literal3-expected.txt +++ /dev/null @@ -1,615 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "upperWord", - "loc": { - "start": { - "line": 16, - "column": 6 - }, - "end": { - "line": 16, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Uppercase", - "loc": { - "start": { - "line": 16, - "column": 53 - }, - "end": { - "line": 16, - "column": 62 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Str", - "loc": { - "start": { - "line": 16, - "column": 63 - }, - "end": { - "line": 16, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 63 - }, - "end": { - "line": 16, - "column": 66 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 62 - }, - "end": { - "line": 16, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 53 - }, - "end": { - "line": 16, - "column": 62 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "OpenHarmony-", - "cooked": "OpenHarmony-" - }, - "loc": { - "start": { - "line": 16, - "column": 39 - }, - "end": { - "line": 16, - "column": 51 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 16, - "column": 68 - }, - "end": { - "line": 16, - "column": 68 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 38 - }, - "end": { - "line": 16, - "column": 69 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Str", - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 16, - "column": 28 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 15 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 70 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "lowerWord", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSTemplateLiteralType", - "references": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Lowercase", - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 62 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Str", - "loc": { - "start": { - "line": 17, - "column": 63 - }, - "end": { - "line": 17, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 63 - }, - "end": { - "line": 17, - "column": 66 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 62 - }, - "end": { - "line": 17, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 62 - } - } - } - ], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "OpenHarmony-", - "cooked": "OpenHarmony-" - }, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 51 - } - } - }, - { - "type": "TemplateElement", - "value": { - "raw": "", - "cooked": "" - }, - "loc": { - "start": { - "line": 17, - "column": 68 - }, - "end": { - "line": 17, - "column": 68 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 69 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Str", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "upperArk", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "upperWord", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "Ark", - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "lowerArk", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "lowerWord", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "Ark", - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-template-literal3.ts b/es2panda/test/parser/ts/test-type-template-literal3.ts deleted file mode 100644 index bd5fc825c65dac3e38af721b1894bd7874565485..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-template-literal3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -type upperWord = `OpenHarmony-${Uppercase}`; -type lowerWord = `OpenHarmony-${Lowercase}`; -type upperArk = upperWord<"Ark">; -type lowerArk = lowerWord<"Ark">; diff --git a/es2panda/test/parser/ts/test-type-with-comma-expected.txt b/es2panda/test/parser/ts/test-type-with-comma-expected.txt deleted file mode 100644 index e65a5a3ac5059b61e0209d53f1c392b2215f071d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-with-comma-expected.txt +++ /dev/null @@ -1,300 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "isNotNull", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - { - "type": "TSNullKeyword", - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 29 - } - } - } - ], - "returnType": { - "type": "TSTypePredicate", - "parameterName": { - "type": "Identifier", - "name": "value", - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, - "asserts": false, - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "body": { - "type": "BinaryExpression", - "operator": "!==", - "left": { - "type": "Identifier", - "name": "value", - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 61 - } - } - }, - "right": { - "type": "NullLiteral", - "value": null, - "loc": { - "start": { - "line": 17, - "column": 66 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 70 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 71 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-with-comma.ts b/es2panda/test/parser/ts/test-type-with-comma.ts deleted file mode 100644 index 1b158d6d963f61308d66f788ca5f63a93dc87ed1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-with-comma.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const isNotNull = (value: T | null): value is T => value !== null; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt b/es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt deleted file mode 100644 index 43e1bd3b89f38baa019ee10a9882fbabbd037032..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-with-specieal-constructor-expected.txt +++ /dev/null @@ -1,407 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ClassExample", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 18 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 21 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 27, - "column": 11 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 20 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 30, - "column": 23 - }, - "end": { - "line": 30, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 21 - }, - "end": { - "line": 30, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 10 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 29, - "column": 11 - }, - "end": { - "line": 29, - "column": 17 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 10 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 31, - "column": 6 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 31, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 32, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 32, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-type-with-specieal-constructor.ts b/es2panda/test/parser/ts/test-type-with-specieal-constructor.ts deleted file mode 100644 index 2000dd2a79e1ca7c3ad57db43b96c186575bc950..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-type-with-specieal-constructor.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class ClassExample { - constructor(a: 'hello'); - constructor(a: 'bye'); - constructor(a: string); - constructor(a) { - return a; - } -} - -declare namespace ns { - class A { - constructor(); - a:string; - constructor(x:number); - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-typeQuery1-expected.txt b/es2panda/test/parser/ts/test-typeQuery1-expected.txt deleted file mode 100644 index fd51e596d58839dad5af1a1cc1887a9eafbc6a4b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-typeQuery1-expected.txt +++ /dev/null @@ -1,126 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "this", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "right": { - "type": "Identifier", - "name": "length", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 30 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-typeQuery1.ts b/es2panda/test/parser/ts/test-typeQuery1.ts deleted file mode 100644 index 943997a3c10f5333290d3ebec53cfc77183b1b74..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-typeQuery1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let x: typeof this.length = 1; diff --git a/es2panda/test/parser/ts/test-typeQuery2-expected.txt b/es2panda/test/parser/ts/test-typeQuery2-expected.txt deleted file mode 100644 index b5bac5f56ec051f42e21bd6a0487a58b2300901b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-typeQuery2-expected.txt +++ /dev/null @@ -1,185 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "thisParam": { - "type": "Identifier", - "name": "this", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "this", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 27 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-typeQuery2.ts b/es2panda/test/parser/ts/test-typeQuery2.ts deleted file mode 100644 index 0b2bbfc6b6f0b5dd6bfc26e0d38bbe1a0bc119d5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-typeQuery2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function f(this:number){ - let x: typeof this = 1; -} diff --git a/es2panda/test/parser/ts/test-unary-expression-followedby-type-assertion-expected.txt b/es2panda/test/parser/ts/test-unary-expression-followedby-type-assertion-expected.txt deleted file mode 100644 index cd33a5f033a4ceafcbe9b366d46621127819588a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-unary-expression-followedby-type-assertion-expected.txt +++ /dev/null @@ -1,386 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - "generator": false, - "async": true, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UnaryExpression", - "operator": "typeof", - "prefix": true, - "argument": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "expression": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AwaitExpression", - "argument": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "expression": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "expression": { - "type": "UnaryExpression", - "operator": "void", - "prefix": true, - "argument": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 34 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "init": { - "type": "LogicalExpression", - "operator": "||", - "left": { - "type": "AwaitExpression", - "argument": { - "type": "TSTypeAssertion", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "expression": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "right": { - "type": "AwaitExpression", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 39 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 40 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test-unary-expression-followedby-type-assertion.ts b/es2panda/test/parser/ts/test-unary-expression-followedby-type-assertion.ts deleted file mode 100644 index 5911d546a90eb70ab672fdd99e4bb199f4c6c396..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-unary-expression-followedby-type-assertion.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -async function foo() { - typeof 1; - await void 0; - let a = await 0 || await 1; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-without-ending-lf-expected.txt b/es2panda/test/parser/ts/test-without-ending-lf-expected.txt deleted file mode 100644 index 581f279deefa9e342dbb561acc87164b15afe4e9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-without-ending-lf-expected.txt +++ /dev/null @@ -1,367 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 101, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 102, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "right": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test-without-ending-lf.ts b/es2panda/test/parser/ts/test-without-ending-lf.ts deleted file mode 100644 index 779871aa71396e63fb59cbc2205d33fd1dcae999..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test-without-ending-lf.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function print() : number { - let a : number = 101; - let b : number = 102; - return a + b; -} - -let c : number = print(); // without '0x0a' \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor1-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor1-expected.txt deleted file mode 100644 index 192fdeafe3eaa6fedc10d25f829b3736acaf4469..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor1-expected.txt +++ /dev/null @@ -1,249 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "id", - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 5 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "name", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": true, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "gid", - "loc": { - "start": { - "line": 20, - "column": 7 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": true, - "key": { - "type": "Identifier", - "name": "sid", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "id", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 21, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Obj", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor1.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor1.ts deleted file mode 100644 index ea2fef9b12db430152098af4cb11c4bb261a532c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor1.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Obj { - id: number; - name: string; - get gid(): number; - set sid(id: number); -} - diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor10-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor10-expected.txt deleted file mode 100644 index 1a1c8b5933b274aee89c43cd9f4b8e8d7e4b8fa4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Keyword must not contain escaped characters [test_GetOrSetAccessor10.ts:18:5] diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor10.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor10.ts deleted file mode 100644 index dbd7389d8b60a21d5bc03988ceb5635142ed6f76..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor10.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I2 { - s\u0065t Name():number; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor2-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor2-expected.txt deleted file mode 100644 index 8d01cf65a299839a10d37e945006f3c606928ba9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor2-expected.txt +++ /dev/null @@ -1,234 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "id", - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 5 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "name1", - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 3 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": true, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": true, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "getname1", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 3 - }, - "end": { - "line": 21, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Obj", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor2.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor2.ts deleted file mode 100644 index 0962f39c9118d1637d4babefb8917ca0e3728854..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor2.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Obj { - id: number; - name1: string; - get?(): number; - get getname1():number; -} - diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor3-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor3-expected.txt deleted file mode 100644 index c8e2a92971b0b21cfe6a2a4231b13c25f930c66c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor3-expected.txt +++ /dev/null @@ -1,192 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get1", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get2", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Obj", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor3.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor3.ts deleted file mode 100644 index e1fa572ad849e7a4adaf4889d435acfc5d9e4654..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor3.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Obj { - get1():void; - get2():void; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor4-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor4-expected.txt deleted file mode 100644 index 21945d7778089454b6b4981df2ca6fa0bb1e547a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor4-expected.txt +++ /dev/null @@ -1,192 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "set1", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "set2", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "Obj", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 4 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor4.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor4.ts deleted file mode 100644 index 14a63fa18209e10e4784a53ed862adadbbefc60a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor4.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Obj { - set1():void; - set2():void; - } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor5-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor5-expected.txt deleted file mode 100644 index 1cf534ae47a58f49d4a797ed4a3eed970ed51a93..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor5-expected.txt +++ /dev/null @@ -1,192 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": true, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "setid", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 8 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - "id": { - "type": "Identifier", - "name": "Obj", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 4 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor5.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor5.ts deleted file mode 100644 index c1181edb3bb3029d31457a1e1c55cd121872fecb..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor5.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Obj { - setid?():void; - set():void; - } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor6-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor6-expected.txt deleted file mode 100644 index ab6802971d010615b9074d95b8a260fe5acb34c6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor6-expected.txt +++ /dev/null @@ -1,163 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": true, - "key": { - "type": "Identifier", - "name": "set", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "p", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": true, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor6.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor6.ts deleted file mode 100644 index 9432f214a38b7f42ed54be2cfb018e67d917a476..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor6.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I1 { - set set(p:string); - get get():number; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor7-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor7-expected.txt deleted file mode 100644 index f5538e65e48ac6896e61e11f2a0dff5868d83acd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor7-expected.txt +++ /dev/null @@ -1,714 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest1", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 23, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest2", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest3", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": true, - "readonly": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 31, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest4", - "loc": { - "start": { - "line": 29, - "column": 11 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 34, - "column": 5 - }, - "end": { - "line": 34, - "column": 8 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 5 - }, - "end": { - "line": 34, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 17 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest5", - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 8 - } - } - }, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 8 - }, - "end": { - "line": 38, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 14 - }, - "end": { - "line": 38, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 17 - }, - "end": { - "line": 39, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest6", - "loc": { - "start": { - "line": 37, - "column": 11 - }, - "end": { - "line": 37, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 37, - "column": 1 - }, - "end": { - "line": 39, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": true, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 8 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 42, - "column": 12 - }, - "end": { - "line": 42, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 17 - }, - "end": { - "line": 43, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest7", - "loc": { - "start": { - "line": 41, - "column": 11 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 41, - "column": 1 - }, - "end": { - "line": 43, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "get", - "loc": { - "start": { - "line": 46, - "column": 5 - }, - "end": { - "line": 46, - "column": 8 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 5 - }, - "end": { - "line": 46, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 45, - "column": 17 - }, - "end": { - "line": 47, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Iest8", - "loc": { - "start": { - "line": 45, - "column": 11 - }, - "end": { - "line": 45, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 45, - "column": 1 - }, - "end": { - "line": 47, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 47, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor7.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor7.ts deleted file mode 100644 index e65f23e711f1a9474a7e10125329db2e823a9c3e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor7.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Iest1 { - get:number -} - -interface Iest2 { - get -} - -interface Iest3 { - get; -} - -interface Iest4 { - get?:number -} - -interface Iest5 { - get():number; -} - -interface Iest6 { - get():number; -} - -interface Iest7 { - get?():number; -} - -interface Iest8 { - get, -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor8-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor8-expected.txt deleted file mode 100644 index 5deaadd4d15252687f18b08490fa252194669787..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor8-expected.txt +++ /dev/null @@ -1,90 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": true, - "optional": false, - "isGetAccessor": true, - "isSetAccessor": false, - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "params": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 3 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor8.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor8.ts deleted file mode 100644 index 624d9747a2963fc8a84c1d0103de732af82add49..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor8.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I { - get [1](); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor9-expected.txt b/es2panda/test/parser/ts/test_GetOrSetAccessor9-expected.txt deleted file mode 100644 index 83b3307e9716aa3bff4493e412940dea92ad5753..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor9-expected.txt +++ /dev/null @@ -1,103 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": true, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "I", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 19, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I2", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_GetOrSetAccessor9.ts b/es2panda/test/parser/ts/test_GetOrSetAccessor9.ts deleted file mode 100644 index 673ef3d3c8d134bc934b1d169de26d882b228062..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_GetOrSetAccessor9.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I2 { - get - I():number; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator-expected.txt b/es2panda/test/parser/ts/test_decorator-expected.txt deleted file mode 100644 index 10c6836845237fcf3ee7a6f1e9f35ad036d96e95..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator-expected.txt +++ /dev/null @@ -1,963 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Baz", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 21 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 16 - }, - "end": { - "line": 27, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 16 - }, - "end": { - "line": 27, - "column": 31 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 31 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "overloads": [], - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 7 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 7 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "kind": "set", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 12 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - "overloads": [], - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 7 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "kind": "get", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "1", - "loc": { - "start": { - "line": 28, - "column": 11 - }, - "end": { - "line": 28, - "column": 14 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": true, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "overloads": [], - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "Identifier", - "name": "dec", - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "StringLiteral", - "value": "h", - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 18 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": true, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 25 - } - } - }, - "overloads": [], - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "dec", - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 9 - } - } - }, - "property": { - "type": "Identifier", - "name": "dec", - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 13 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 25 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 30, - "column": 2 - } - } - }, - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 5 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 5 - } - } - }, - { - "type": "Decorator", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 30, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 31, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_decorator.ts b/es2panda/test/parser/ts/test_decorator.ts deleted file mode 100644 index a5b3a94f0758a7dc25db179594a57c6db8bacdca..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -@foo @bar() -class Baz { - a(); - @c - a() { } - @d - c: number; - @e() - set b(f) { }; - get b() { return 1; }; - constructor(@g a: any) { }; - @dec ["1"]() { } - @dec.dec ["h"]() { } -} diff --git a/es2panda/test/parser/ts/test_decorator1-expected.txt b/es2panda/test/parser/ts/test_decorator1-expected.txt deleted file mode 100644 index 02e207a1f4f616b6de8445832680d9b81888612a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected token, expected an identifier. [test_decorator1.ts:17:14] diff --git a/es2panda/test/parser/ts/test_decorator1.ts b/es2panda/test/parser/ts/test_decorator1.ts deleted file mode 100644 index ad35ff16997d8c68df717b3bebbc01bbbbe797af..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function foo(@dec a) { }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator10-expected.txt b/es2panda/test/parser/ts/test_decorator10-expected.txt deleted file mode 100644 index 5ec6d24f20ab94d05a48680a63ebae7f0a34fb94..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator10-expected.txt +++ /dev/null @@ -1,948 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "Observed", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "constructor_", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - { - "type": "Identifier", - "name": "_", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 45 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 39 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ClassExpression", - "definition": { - "id": null, - "superClass": { - "type": "Identifier", - "name": "constructor_", - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 47 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "NVJSONLabelModel", - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Object", - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "value": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "NVJSONLabelModel", - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 40 - } - } - }, - "property": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 23, - "column": 41 - }, - "end": { - "line": 23, - "column": 45 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 45 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 47 - } - } - }, - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 47 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "kind": "method", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 16 - }, - "end": { - "line": 26, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 16 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 16 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 22, - "column": 39 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "decorators": [ - { - "type": "Decorator", - "expression": { - "type": "Identifier", - "name": "Observed", - "loc": { - "start": { - "line": 21, - "column": 2 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "arguments": [ - { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "NVJSONLabelModel", - "loc": { - "start": { - "line": 30, - "column": 7 - }, - "end": { - "line": 30, - "column": 23 - } - } - }, - "property": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 30, - "column": 24 - }, - "end": { - "line": 30, - "column": 28 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 7 - }, - "end": { - "line": 30, - "column": 28 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 7 - }, - "end": { - "line": 30, - "column": 30 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 31, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_decorator10.ts b/es2panda/test/parser/ts/test_decorator10.ts deleted file mode 100644 index a33d7bb9fa40b8e0cf35e055c3ddebe8c7cb9546..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator10.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function Observed(constructor_: any, _?: any) { - return class extends constructor_ {} -} - -@Observed -class NVJSONLabelModel extends Object { - static a: number = NVJSONLabelModel.func(); - - static func():number { - return 1; - } -} - -print(NVJSONLabelModel.func()); diff --git a/es2panda/test/parser/ts/test_decorator2-expected.txt b/es2panda/test/parser/ts/test_decorator2-expected.txt deleted file mode 100644 index 7d3c1346a3107b58b64e05679b960459ec5cc815..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test_decorator2.ts:17:1] diff --git a/es2panda/test/parser/ts/test_decorator2.ts b/es2panda/test/parser/ts/test_decorator2.ts deleted file mode 100644 index a904974dd1b1b0bbef0eb34e6615f1a0bfac4fe8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -@bar; -class Foo { - -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator3-expected.txt b/es2panda/test/parser/ts/test_decorator3-expected.txt deleted file mode 100644 index 733a328eb62958a203137c1d1e0a5044281aa377..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators cannot be applied to multiple get/set accessors of the same name. [test_decorator3.ts:20:5] diff --git a/es2panda/test/parser/ts/test_decorator3.ts b/es2panda/test/parser/ts/test_decorator3.ts deleted file mode 100644 index 5d55ddf958aaea7c6005048e7b3fe4d0bbde6d33..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator3.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -@bar -class Foo { - @dec set baz(a) { }; - @dec get baz() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator4-expected.txt b/es2panda/test/parser/ts/test_decorator4-expected.txt deleted file mode 100644 index e99ec9e98793a4bec2379f938286e723a207b4bd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A decorator can only decorate a method implementation, not an overload. [test_decorator4.ts:18:5] diff --git a/es2panda/test/parser/ts/test_decorator4.ts b/es2panda/test/parser/ts/test_decorator4.ts deleted file mode 100644 index 8dec3658df174ed28e7c6a61f10b9155eadc6246..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - @dec a(); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator5-expected.txt b/es2panda/test/parser/ts/test_decorator5-expected.txt deleted file mode 100644 index 42946f76c970c655a30bc19015d2e4e2fcea453b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test_decorator5.ts:18:5] diff --git a/es2panda/test/parser/ts/test_decorator5.ts b/es2panda/test/parser/ts/test_decorator5.ts deleted file mode 100644 index 8a51550bf7ccb4551b4661ecde5046d9b07f5983..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator5.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - @dec constructor() { }; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator6-expected.txt b/es2panda/test/parser/ts/test_decorator6-expected.txt deleted file mode 100644 index 874888faa64475b94ce091b556c0d6136805e068..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test_decorator6.ts:18:5] diff --git a/es2panda/test/parser/ts/test_decorator6.ts b/es2panda/test/parser/ts/test_decorator6.ts deleted file mode 100644 index 88ccd8408c9b65743e6eac6f617b746031178a7b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator6.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class Foo { - @dec [a: number]: string; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator7-expected.txt b/es2panda/test/parser/ts/test_decorator7-expected.txt deleted file mode 100644 index fd6c75c252a86c329cfb8d02c230047408b2cde0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test_decorator7.ts:17:1] diff --git a/es2panda/test/parser/ts/test_decorator7.ts b/es2panda/test/parser/ts/test_decorator7.ts deleted file mode 100644 index 9726df035cfb20c916ad6257311ef16858c7cee2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -@bar -export default function foo() { -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator8-expected.txt b/es2panda/test/parser/ts/test_decorator8-expected.txt deleted file mode 100644 index 9bb30c000c964d8363dc6f5b3432d56b862291d3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator8-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test_decorator8.ts:17:1] diff --git a/es2panda/test/parser/ts/test_decorator8.ts b/es2panda/test/parser/ts/test_decorator8.ts deleted file mode 100644 index fb983d6d42cda3dfe52760faa92b43035495e8e1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator8.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -@bar -export function foo() { -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_decorator9-expected.txt b/es2panda/test/parser/ts/test_decorator9-expected.txt deleted file mode 100644 index 099cf571ef92938a9052f75bc10c50e03d668664..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator9-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Decorators are not valid here. [test_decorator9.ts:20:5] diff --git a/es2panda/test/parser/ts/test_decorator9.ts b/es2panda/test/parser/ts/test_decorator9.ts deleted file mode 100644 index 7d8667cf789945696e7f0e50ec7c4b37579f801e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_decorator9.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare function dec(target: T): T; - -class A { - @dec - #foo = 1; - @dec - #bar(): void { } -} diff --git a/es2panda/test/parser/ts/test_export-declaration-named-namespace-error-expected.txt b/es2panda/test/parser/ts/test_export-declaration-named-namespace-error-expected.txt deleted file mode 100644 index d7d356f8fe4a34bf93dfc6d56509ded445659d3c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export-declaration-named-namespace-error-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Export name '_func' is not defined. [test_export-declaration-named-namespace-error.ts:18:14] diff --git a/es2panda/test/parser/ts/test_export-declaration-named-namespace-error.ts b/es2panda/test/parser/ts/test_export-declaration-named-namespace-error.ts deleted file mode 100644 index 0e0e3aca69caaee1b9d74d30f467402518352b2a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export-declaration-named-namespace-error.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare namespace ns { - export { _func as try }; -} - -ns.try(() => { }); \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_export-declaration-named-namespace-expected.txt b/es2panda/test/parser/ts/test_export-declaration-named-namespace-expected.txt deleted file mode 100644 index d5875474c9d62bcf87b11879150a19e15bb10547..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export-declaration-named-namespace-expected.txt +++ /dev/null @@ -1,827 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_func", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "p", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Function", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 42 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 42 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 36 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 40 - } - } - } - ], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 50 - }, - "end": { - "line": 18, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "_func", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "exported": { - "type": "Identifier", - "name": "try", - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - "property": { - "type": "Identifier", - "name": "try", - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 7 - } - } - }, - "arguments": [ - { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 17 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 19 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns1", - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSEnumDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "members": [], - "const": false, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "exported": { - "type": "Identifier", - "name": "enum1", - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 23 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 29, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "nullns", - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 25 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 29, - "column": 25 - }, - "end": { - "line": 31, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 32, - "column": 7 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "nullns", - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, - "exported": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 32, - "column": 20 - }, - "end": { - "line": 32, - "column": 23 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 32, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns2", - "loc": { - "start": { - "line": 34, - "column": 19 - }, - "end": { - "line": 34, - "column": 22 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 35, - "column": 17 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 35, - "column": 17 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 35, - "column": 12 - }, - "end": { - "line": 35, - "column": 18 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 23 - }, - "end": { - "line": 36, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 38, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "ns2", - "loc": { - "start": { - "line": 38, - "column": 19 - }, - "end": { - "line": 38, - "column": 22 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 39, - "column": 13 - }, - "end": { - "line": 39, - "column": 14 - } - } - }, - "exported": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 39, - "column": 18 - }, - "end": { - "line": 39, - "column": 19 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 39, - "column": 13 - }, - "end": { - "line": 39, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 23 - }, - "end": { - "line": 40, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 40, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 40, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_export-declaration-named-namespace.ts b/es2panda/test/parser/ts/test_export-declaration-named-namespace.ts deleted file mode 100644 index 41e091d2adffb4962a53075a389aea718a59599e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export-declaration-named-namespace.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare namespace ns { - function _func(p: Function, ...args: any[]): any; - export { _func as try }; -} - -ns.try(() => { }); - -declare namespace ns1 { - enum a {} - export { a as enum1 }; -} - -declare namespace nullns{ - -} -export { nullns as foo } - -declare namespace ns2 { - export var a; -} - -declare namespace ns2 { - export {a as b} -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_export-function-overload-expected.txt b/es2panda/test/parser/ts/test_export-function-overload-expected.txt deleted file mode 100644 index 53bebdd4f729a6c70660c6b8b4ec2d35c8a0b703..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export-function-overload-expected.txt +++ /dev/null @@ -1,392 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 53 - }, - "end": { - "line": 17, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 47 - }, - "end": { - "line": 17, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 44 - }, - "end": { - "line": 17, - "column": 51 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 17, - "column": 61 - }, - "end": { - "line": 17, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 66 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 66 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 36 - }, - "end": { - "line": 18, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 34 - } - } - } - ], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 48 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "right": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 49 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_export-function-overload.ts b/es2panda/test/parser/ts/test_export-function-overload.ts deleted file mode 100644 index 593f76bc07c1982699d4f3e9394c54d82c300c4d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export-function-overload.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export function func(a: number, b: string, ...args: any[]): void; -export function func(a: number, b: string): any { - return a + b; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_export_AssertClause1-expected.txt b/es2panda/test/parser/ts/test_export_AssertClause1-expected.txt deleted file mode 100644 index 197b7ea89009e0ec828e9c3f6e0228fce1e2bdd8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_AssertClause1-expected.txt +++ /dev/null @@ -1,225 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "exported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - } - ], - "assertClause": { - "type": "AssertClause", - "elements": [ - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key1", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value1", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key2", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value2", - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key3", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value3", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 23, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 23, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 24, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_export_AssertClause1.ts b/es2panda/test/parser/ts/test_export_AssertClause1.ts deleted file mode 100644 index e0ee14d594274862ea92e7a8044e5b06522bfa06..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_AssertClause1.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export { a } from "test" assert { - key1 - : - "value1", - key2: "value2", - key3: - "value3", }; diff --git a/es2panda/test/parser/ts/test_export_AssertClause2-expected.txt b/es2panda/test/parser/ts/test_export_AssertClause2-expected.txt deleted file mode 100644 index 771713df0629ec63993f5d64a5e03551d42dd46b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_AssertClause2-expected.txt +++ /dev/null @@ -1,112 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportAllDeclaration", - "source": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "exported": { - "type": "Identifier", - "name": "ns", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "assertClause": { - "type": "AssertClause", - "elements": [ - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key", - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 5 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_export_AssertClause2.ts b/es2panda/test/parser/ts/test_export_AssertClause2.ts deleted file mode 100644 index af1ef7f218938eddbfafe99785fb03c633563f11..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_AssertClause2.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export * as ns from "test" assert -{key: "value"}; diff --git a/es2panda/test/parser/ts/test_export_type-expected.txt b/es2panda/test/parser/ts/test_export_type-expected.txt deleted file mode 100644 index 843907cc135e934b08b4d4f838d7f8a26234f22d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_type-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: The type modifier cannot be used on a named export when 'export type' is used on its export statement. [test_export_type.ts:17:23] diff --git a/es2panda/test/parser/ts/test_export_type.ts b/es2panda/test/parser/ts/test_export_type.ts deleted file mode 100644 index c0210e492bb9e72809a2d0ef244a4e211acb348b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_type.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export type { a, type b }; diff --git a/es2panda/test/parser/ts/test_export_type2-expected.txt b/es2panda/test/parser/ts/test_export_type2-expected.txt deleted file mode 100644 index e272df0c29885cb470c0b022731a67f3caa38895..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_type2-expected.txt +++ /dev/null @@ -1,312 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 13 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "exported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "exported": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "exported": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_export_type2.ts b/es2panda/test/parser/ts/test_export_type2.ts deleted file mode 100644 index 7db5b428fc750b4cbe5671ef7b785bca460ff976..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_type2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a = 1; -type b = number; -var type = 2; -export { a, type, type b }; diff --git a/es2panda/test/parser/ts/test_export_type3-expected.txt b/es2panda/test/parser/ts/test_export_type3-expected.txt deleted file mode 100644 index e12311fe5b1b03c0d15a31690657f3db1179ffc0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_type3-expected.txt +++ /dev/null @@ -1,114 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [ - { - "type": "ExportSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "exported": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_export_type3.ts b/es2panda/test/parser/ts/test_export_type3.ts deleted file mode 100644 index 5f909a18b45da6240cf2e49fb794f3f378eda76c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_export_type3.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type type = number; -export { type type }; diff --git a/es2panda/test/parser/ts/test_generic-expected.txt b/es2panda/test/parser/ts/test_generic-expected.txt deleted file mode 100644 index aa9c0d064431dbe5a169d8beac2159ecab83c4ef..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_generic-expected.txt +++ /dev/null @@ -1,6969 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "arg", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Type", - "loc": { - "start": { - "line": 17, - "column": 59 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 59 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 54 - }, - "end": { - "line": 17, - "column": 57 - } - } - } - ], - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Type", - "loc": { - "start": { - "line": 17, - "column": 66 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 66 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Type", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "readonly", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 44 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 44 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 53 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 53 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "arg", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 71 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func2", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "constraint": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 21, - "column": 38 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 39 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 42 - }, - "end": { - "line": 21, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 39 - }, - "end": { - "line": 21, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 26 - }, - "end": { - "line": 21, - "column": 50 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 51 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 51 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 54 - }, - "end": { - "line": 21, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 57 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func3", - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 23, - "column": 90 - }, - "end": { - "line": 23, - "column": 91 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 90 - }, - "end": { - "line": 23, - "column": 91 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 87 - }, - "end": { - "line": 23, - "column": 88 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 96 - }, - "end": { - "line": 23, - "column": 102 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 93 - }, - "end": { - "line": 23, - "column": 94 - } - } - } - ], - "returnType": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 105 - }, - "end": { - "line": 23, - "column": 111 - } - } - }, - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 23, - "column": 114 - }, - "end": { - "line": 23, - "column": 121 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 105 - }, - "end": { - "line": 23, - "column": 121 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 34 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 39 - }, - "end": { - "line": 23, - "column": 40 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 42 - }, - "end": { - "line": 23, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 39 - }, - "end": { - "line": 23, - "column": 49 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 23, - "column": 50 - }, - "end": { - "line": 23, - "column": 51 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 23, - "column": 53 - }, - "end": { - "line": 23, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 50 - }, - "end": { - "line": 23, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 37 - }, - "end": { - "line": 23, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 34 - }, - "end": { - "line": 23, - "column": 63 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 23, - "column": 64 - }, - "end": { - "line": 23, - "column": 65 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 68 - }, - "end": { - "line": 23, - "column": 74 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 76 - }, - "end": { - "line": 23, - "column": 82 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 67 - }, - "end": { - "line": 23, - "column": 83 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 64 - }, - "end": { - "line": 23, - "column": 85 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 32 - }, - "end": { - "line": 23, - "column": 85 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 26 - }, - "end": { - "line": 23, - "column": 85 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 86 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 86 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 122 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "PromiseConstructorLike", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 36 - } - } - }, - "typeAnnotation": { - "type": "TSConstructorType", - "params": [ - { - "type": "Identifier", - "name": "executor", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "resolve", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 75 - }, - "end": { - "line": 27, - "column": 76 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 75 - }, - "end": { - "line": 27, - "column": 76 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "PromiseLike", - "loc": { - "start": { - "line": 27, - "column": 79 - }, - "end": { - "line": 27, - "column": 90 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 91 - }, - "end": { - "line": 27, - "column": 92 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 91 - }, - "end": { - "line": 27, - "column": 92 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 90 - }, - "end": { - "line": 27, - "column": 93 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 79 - }, - "end": { - "line": 27, - "column": 90 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 75 - }, - "end": { - "line": 27, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 68 - }, - "end": { - "line": 27, - "column": 73 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 27, - "column": 98 - }, - "end": { - "line": 27, - "column": 102 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 67 - }, - "end": { - "line": 27, - "column": 102 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 58 - }, - "end": { - "line": 27, - "column": 65 - } - } - }, - { - "type": "Identifier", - "name": "reject", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "reason", - "typeAnnotation": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 27, - "column": 122 - }, - "end": { - "line": 27, - "column": 125 - } - } - }, - "optional": true, - "loc": { - "start": { - "line": 27, - "column": 113 - }, - "end": { - "line": 27, - "column": 119 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 27, - "column": 130 - }, - "end": { - "line": 27, - "column": 134 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 112 - }, - "end": { - "line": 27, - "column": 134 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 104 - }, - "end": { - "line": 27, - "column": 110 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 27, - "column": 139 - }, - "end": { - "line": 27, - "column": 143 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 57 - }, - "end": { - "line": 27, - "column": 143 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 47 - }, - "end": { - "line": 27, - "column": 55 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 44 - }, - "end": { - "line": 27, - "column": 45 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 44 - }, - "end": { - "line": 27, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 43 - }, - "end": { - "line": 27, - "column": 46 - } - } - }, - "returnType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "PromiseLike", - "loc": { - "start": { - "line": 27, - "column": 148 - }, - "end": { - "line": 27, - "column": 159 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 160 - }, - "end": { - "line": 27, - "column": 161 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 160 - }, - "end": { - "line": 27, - "column": 161 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 159 - }, - "end": { - "line": 27, - "column": 162 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 148 - }, - "end": { - "line": 27, - "column": 159 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 39 - }, - "end": { - "line": 27, - "column": 159 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 163 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 30, - "column": 8 - }, - "end": { - "line": 30, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 15 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 28 - }, - "end": { - "line": 31, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 34 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 53 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "R", - "loc": { - "start": { - "line": 29, - "column": 11 - }, - "end": { - "line": 29, - "column": 12 - } - } - }, - "extends": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "K", - "loc": { - "start": { - "line": 29, - "column": 13 - }, - "end": { - "line": 29, - "column": 14 - } - } - }, - "constraint": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 29, - "column": 24 - }, - "end": { - "line": 29, - "column": 30 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 29, - "column": 32 - }, - "end": { - "line": 29, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 23 - }, - "end": { - "line": 29, - "column": 39 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 13 - }, - "end": { - "line": 29, - "column": 40 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 29, - "column": 41 - }, - "end": { - "line": 29, - "column": 42 - } - } - }, - "default": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 29, - "column": 45 - }, - "end": { - "line": 29, - "column": 51 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 41 - }, - "end": { - "line": 29, - "column": 52 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 12 - }, - "end": { - "line": 29, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 32, - "column": 2 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSCallSignatureDeclaration", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 35, - "column": 6 - }, - "end": { - "line": 35, - "column": 7 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 35, - "column": 6 - }, - "end": { - "line": 35, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 8 - } - } - }, - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 35, - "column": 12 - }, - "end": { - "line": 35, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 19 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "readonly", - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 13 - } - } - }, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 36, - "column": 14 - }, - "end": { - "line": 36, - "column": 15 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 36, - "column": 24 - }, - "end": { - "line": 36, - "column": 30 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 36, - "column": 14 - }, - "end": { - "line": 36, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 13 - }, - "end": { - "line": 36, - "column": 31 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 36, - "column": 36 - }, - "end": { - "line": 36, - "column": 43 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 36, - "column": 45 - }, - "end": { - "line": 36, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 45 - }, - "end": { - "line": 36, - "column": 53 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 35 - }, - "end": { - "line": 36, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 55 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 117 - }, - "end": { - "line": 37, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 34, - "column": 11 - }, - "end": { - "line": 34, - "column": 12 - } - } - }, - "extends": [ - { - "type": "TSInterfaceHeritage", - "expression": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "R", - "loc": { - "start": { - "line": 34, - "column": 97 - }, - "end": { - "line": 34, - "column": 98 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 100 - }, - "end": { - "line": 34, - "column": 106 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 34, - "column": 108 - }, - "end": { - "line": 34, - "column": 114 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 99 - }, - "end": { - "line": 34, - "column": 115 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 98 - }, - "end": { - "line": 34, - "column": 116 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 117 - }, - "end": { - "line": 34, - "column": 116 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 117 - }, - "end": { - "line": 34, - "column": 116 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 14 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "readonly", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 33 - }, - "end": { - "line": 34, - "column": 39 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 41 - }, - "end": { - "line": 34, - "column": 47 - } - } - }, - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 34, - "column": 51 - }, - "end": { - "line": 34, - "column": 52 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 54 - }, - "end": { - "line": 34, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 51 - }, - "end": { - "line": 34, - "column": 61 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 34, - "column": 62 - }, - "end": { - "line": 34, - "column": 63 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 34, - "column": 65 - }, - "end": { - "line": 34, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 62 - }, - "end": { - "line": 34, - "column": 73 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 49 - }, - "end": { - "line": 34, - "column": 73 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 32 - }, - "end": { - "line": 34, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 23 - }, - "end": { - "line": 34, - "column": 74 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 75 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Z", - "loc": { - "start": { - "line": 34, - "column": 76 - }, - "end": { - "line": 34, - "column": 77 - } - } - }, - "default": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 34, - "column": 80 - }, - "end": { - "line": 34, - "column": 87 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 34, - "column": 76 - }, - "end": { - "line": 34, - "column": 88 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 88 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 37, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 39, - "column": 1 - }, - "end": { - "line": 39, - "column": 6 - } - } - }, - "arguments": [], - "optional": false, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 39, - "column": 7 - }, - "end": { - "line": 39, - "column": 13 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 39, - "column": 15 - }, - "end": { - "line": 39, - "column": 21 - } - } - }, - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 39, - "column": 24 - }, - "end": { - "line": 39, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 24 - }, - "end": { - "line": 39, - "column": 25 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 39, - "column": 27 - }, - "end": { - "line": 39, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 27 - }, - "end": { - "line": 39, - "column": 28 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 39, - "column": 30 - }, - "end": { - "line": 39, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 30 - }, - "end": { - "line": 39, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 23 - }, - "end": { - "line": 39, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 6 - }, - "end": { - "line": 39, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 1 - }, - "end": { - "line": 39, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 1 - }, - "end": { - "line": 39, - "column": 35 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func2", - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "arguments": [], - "optional": false, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 40, - "column": 8 - }, - "end": { - "line": 40, - "column": 9 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 40, - "column": 8 - }, - "end": { - "line": 40, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 7 - }, - "end": { - "line": 40, - "column": 10 - } - } - }, - "returnType": { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 40, - "column": 16 - }, - "end": { - "line": 40, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 7 - }, - "end": { - "line": 40, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 6 - }, - "end": { - "line": 40, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 22 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "o", - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 6 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 43, - "column": 18 - }, - "end": { - "line": 43, - "column": 19 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 43, - "column": 18 - }, - "end": { - "line": 43, - "column": 20 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 43, - "column": 21 - }, - "end": { - "line": 43, - "column": 22 - } - } - }, - "constraint": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 43, - "column": 38 - }, - "end": { - "line": 43, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 31 - }, - "end": { - "line": 43, - "column": 43 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 43, - "column": 21 - }, - "end": { - "line": 43, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 43, - "column": 44 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 43, - "column": 47 - }, - "end": { - "line": 43, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 8 - }, - "end": { - "line": 43, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 8 - }, - "end": { - "line": 43, - "column": 50 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 50 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 44, - "column": 5 - }, - "end": { - "line": 44, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "D", - "loc": { - "start": { - "line": 44, - "column": 18 - }, - "end": { - "line": 44, - "column": 19 - } - } - }, - "default": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 44, - "column": 22 - }, - "end": { - "line": 44, - "column": 28 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 44, - "column": 18 - }, - "end": { - "line": 44, - "column": 29 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 44, - "column": 30 - }, - "end": { - "line": 44, - "column": 31 - } - } - }, - "default": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 44, - "column": 34 - }, - "end": { - "line": 44, - "column": 40 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 44, - "column": 30 - }, - "end": { - "line": 44, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 44, - "column": 17 - }, - "end": { - "line": 44, - "column": 41 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 44, - "column": 44 - }, - "end": { - "line": 44, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 8 - }, - "end": { - "line": 44, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 8 - }, - "end": { - "line": 44, - "column": 47 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 44, - "column": 5 - }, - "end": { - "line": 44, - "column": 47 - } - } - }, - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 45, - "column": 7 - }, - "end": { - "line": 45, - "column": 8 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 45, - "column": 7 - }, - "end": { - "line": 45, - "column": 9 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "F", - "loc": { - "start": { - "line": 45, - "column": 10 - }, - "end": { - "line": 45, - "column": 11 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "readonly", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [], - "loc": { - "start": { - "line": 45, - "column": 29 - }, - "end": { - "line": 45, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 20 - }, - "end": { - "line": 45, - "column": 31 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 45, - "column": 10 - }, - "end": { - "line": 45, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 45, - "column": 6 - }, - "end": { - "line": 45, - "column": 32 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 45, - "column": 35 - }, - "end": { - "line": 45, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 6 - }, - "end": { - "line": 45, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 6 - }, - "end": { - "line": 45, - "column": 38 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 45, - "column": 5 - }, - "end": { - "line": 45, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 46, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 46, - "column": 2 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 46, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 48, - "column": 7 - }, - "end": { - "line": 48, - "column": 8 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 48, - "column": 9 - }, - "end": { - "line": 48, - "column": 10 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 48, - "column": 19 - }, - "end": { - "line": 48, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 19 - }, - "end": { - "line": 48, - "column": 20 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 48, - "column": 9 - }, - "end": { - "line": 48, - "column": 21 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Z", - "loc": { - "start": { - "line": 48, - "column": 22 - }, - "end": { - "line": 48, - "column": 23 - } - } - }, - "default": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 48, - "column": 28 - }, - "end": { - "line": 48, - "column": 29 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 48, - "column": 31 - }, - "end": { - "line": 48, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 28 - }, - "end": { - "line": 48, - "column": 38 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 48, - "column": 39 - }, - "end": { - "line": 48, - "column": 40 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 48, - "column": 42 - }, - "end": { - "line": 48, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 39 - }, - "end": { - "line": 48, - "column": 50 - } - } - } - ], - "loc": { - "start": { - "line": 48, - "column": 26 - }, - "end": { - "line": 48, - "column": 50 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 48, - "column": 22 - }, - "end": { - "line": 48, - "column": 51 - } - } - } - ], - "loc": { - "start": { - "line": 48, - "column": 8 - }, - "end": { - "line": 48, - "column": 51 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 48, - "column": 1 - }, - "end": { - "line": 51, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 49, - "column": 12 - }, - "end": { - "line": 49, - "column": 13 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 49, - "column": 14 - }, - "end": { - "line": 49, - "column": 15 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 49, - "column": 14 - }, - "end": { - "line": 49, - "column": 16 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "R", - "loc": { - "start": { - "line": 49, - "column": 17 - }, - "end": { - "line": 49, - "column": 18 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 49, - "column": 17 - }, - "end": { - "line": 49, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 19 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 49, - "column": 22 - }, - "end": { - "line": 49, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 25 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 49, - "column": 5 - }, - "end": { - "line": 49, - "column": 25 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 50, - "column": 13 - }, - "end": { - "line": 50, - "column": 14 - } - } - }, - "kind": "method", - "accessibility": "private", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 50, - "column": 15 - }, - "end": { - "line": 50, - "column": 16 - } - } - }, - "constraint": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 50, - "column": 29 - }, - "end": { - "line": 50, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 26 - }, - "end": { - "line": 50, - "column": 27 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 50, - "column": 40 - }, - "end": { - "line": 50, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 37 - }, - "end": { - "line": 50, - "column": 38 - } - } - } - ], - "returnType": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 50, - "column": 51 - }, - "end": { - "line": 50, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 51 - }, - "end": { - "line": 50, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 25 - }, - "end": { - "line": 50, - "column": 56 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 50, - "column": 15 - }, - "end": { - "line": 50, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 50, - "column": 14 - }, - "end": { - "line": 50, - "column": 57 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 50, - "column": 60 - }, - "end": { - "line": 50, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 14 - }, - "end": { - "line": 50, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 14 - }, - "end": { - "line": 50, - "column": 63 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 50, - "column": 5 - }, - "end": { - "line": 50, - "column": 63 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 48, - "column": 52 - }, - "end": { - "line": 51, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 48, - "column": 1 - }, - "end": { - "line": 51, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "W", - "loc": { - "start": { - "line": 53, - "column": 7 - }, - "end": { - "line": 53, - "column": 8 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 53, - "column": 17 - }, - "end": { - "line": 53, - "column": 18 - } - } - }, - "superTypeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 53, - "column": 20 - }, - "end": { - "line": 53, - "column": 21 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 53, - "column": 20 - }, - "end": { - "line": 53, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 19 - }, - "end": { - "line": 53, - "column": 22 - } - } - }, - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 53, - "column": 29 - }, - "end": { - "line": 53, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 19 - }, - "end": { - "line": 53, - "column": 35 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 53, - "column": 38 - }, - "end": { - "line": 53, - "column": 44 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 53, - "column": 47 - }, - "end": { - "line": 53, - "column": 53 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 38 - }, - "end": { - "line": 53, - "column": 53 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 37 - }, - "end": { - "line": 53, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 37 - }, - "end": { - "line": 53, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 18 - }, - "end": { - "line": 53, - "column": 57 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 1 - }, - "end": { - "line": 55, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 53, - "column": 58 - }, - "end": { - "line": 55, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 1 - }, - "end": { - "line": 55, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "X", - "loc": { - "start": { - "line": 57, - "column": 7 - }, - "end": { - "line": 57, - "column": 8 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "Q", - "loc": { - "start": { - "line": 57, - "column": 17 - }, - "end": { - "line": 57, - "column": 18 - } - } - }, - "superTypeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 57, - "column": 19 - }, - "end": { - "line": 57, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 26 - } - } - }, - "implements": [ - { - "type": "TSClassImplements", - "expression": { - "type": "Identifier", - "name": "S", - "loc": { - "start": { - "line": 57, - "column": 38 - }, - "end": { - "line": 57, - "column": 39 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 57, - "column": 46 - }, - "end": { - "line": 57, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 44 - }, - "end": { - "line": 57, - "column": 45 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 57, - "column": 56 - }, - "end": { - "line": 57, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 54 - }, - "end": { - "line": 57, - "column": 55 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "R", - "loc": { - "start": { - "line": 57, - "column": 41 - }, - "end": { - "line": 57, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 57, - "column": 41 - }, - "end": { - "line": 57, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 57, - "column": 40 - }, - "end": { - "line": 57, - "column": 43 - } - } - }, - "returnType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 57, - "column": 68 - }, - "end": { - "line": 57, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 57, - "column": 67 - }, - "end": { - "line": 57, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 40 - }, - "end": { - "line": 57, - "column": 75 - } - } - } - ], - "loc": { - "start": { - "line": 57, - "column": 39 - }, - "end": { - "line": 57, - "column": 76 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 38 - }, - "end": { - "line": 57, - "column": 77 - } - } - }, - { - "type": "TSClassImplements", - "expression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 57, - "column": 78 - }, - "end": { - "line": 57, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 78 - }, - "end": { - "line": 57, - "column": 81 - } - } - } - ], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 1 - }, - "end": { - "line": 59, - "column": 2 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 57, - "column": 80 - }, - "end": { - "line": 59, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 1 - }, - "end": { - "line": 59, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSConstructorType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 61, - "column": 13 - }, - "end": { - "line": 61, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 61, - "column": 13 - }, - "end": { - "line": 61, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 61, - "column": 12 - }, - "end": { - "line": 61, - "column": 15 - } - } - }, - "returnType": { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 61, - "column": 22 - }, - "end": { - "line": 61, - "column": 23 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 61, - "column": 22 - }, - "end": { - "line": 61, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 61, - "column": 21 - }, - "end": { - "line": 61, - "column": 24 - } - } - }, - "returnType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 61, - "column": 30 - }, - "end": { - "line": 61, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 21 - }, - "end": { - "line": 61, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 8 - }, - "end": { - "line": 61, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 5 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 61, - "column": 5 - }, - "end": { - "line": 61, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 61, - "column": 1 - }, - "end": { - "line": 61, - "column": 37 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 62, - "column": 32 - }, - "end": { - "line": 62, - "column": 38 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 62, - "column": 41 - }, - "end": { - "line": 62, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 62, - "column": 32 - }, - "end": { - "line": 62, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 29 - }, - "end": { - "line": 62, - "column": 30 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 62, - "column": 9 - }, - "end": { - "line": 62, - "column": 10 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 62, - "column": 19 - }, - "end": { - "line": 62, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 19 - }, - "end": { - "line": 62, - "column": 20 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 62, - "column": 9 - }, - "end": { - "line": 62, - "column": 21 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 62, - "column": 22 - }, - "end": { - "line": 62, - "column": 23 - } - } - }, - "default": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 62, - "column": 26 - }, - "end": { - "line": 62, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 26 - }, - "end": { - "line": 62, - "column": 27 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 62, - "column": 22 - }, - "end": { - "line": 62, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 62, - "column": 8 - }, - "end": { - "line": 62, - "column": 28 - } - } - }, - "returnType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 62, - "column": 54 - }, - "end": { - "line": 62, - "column": 55 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 62, - "column": 57 - }, - "end": { - "line": 62, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 54 - }, - "end": { - "line": 62, - "column": 65 - } - } - } - ], - "loc": { - "start": { - "line": 62, - "column": 52 - }, - "end": { - "line": 62, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 8 - }, - "end": { - "line": 62, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 5 - }, - "end": { - "line": 62, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 62, - "column": 5 - }, - "end": { - "line": 62, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 62, - "column": 1 - }, - "end": { - "line": 62, - "column": 66 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "TSIndexedAccessType", - "objectType": { - "type": "TSTypeReference", - "typeName": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 64, - "column": 8 - }, - "end": { - "line": 64, - "column": 9 - } - } - }, - "right": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 64, - "column": 10 - }, - "end": { - "line": 64, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 8 - }, - "end": { - "line": 64, - "column": 12 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 64, - "column": 12 - }, - "end": { - "line": 64, - "column": 13 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 64, - "column": 14 - }, - "end": { - "line": 64, - "column": 15 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 64, - "column": 16 - }, - "end": { - "line": 64, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 64, - "column": 15 - }, - "end": { - "line": 64, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 14 - }, - "end": { - "line": 64, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 64, - "column": 13 - }, - "end": { - "line": 64, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 12 - }, - "end": { - "line": 64, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 64, - "column": 11 - }, - "end": { - "line": 64, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 8 - }, - "end": { - "line": 64, - "column": 26 - } - } - }, - "indexType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 64, - "column": 26 - }, - "end": { - "line": 64, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 26 - }, - "end": { - "line": 64, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 8 - }, - "end": { - "line": 64, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 5 - }, - "end": { - "line": 64, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 64, - "column": 5 - }, - "end": { - "line": 64, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 64, - "column": 1 - }, - "end": { - "line": 64, - "column": 29 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 65, - "column": 8 - }, - "end": { - "line": 65, - "column": 9 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 65, - "column": 10 - }, - "end": { - "line": 65, - "column": 16 - } - } - }, - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 65, - "column": 20 - }, - "end": { - "line": 65, - "column": 21 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 65, - "column": 23 - }, - "end": { - "line": 65, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 65, - "column": 20 - }, - "end": { - "line": 65, - "column": 30 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 65, - "column": 31 - }, - "end": { - "line": 65, - "column": 32 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 65, - "column": 34 - }, - "end": { - "line": 65, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 65, - "column": 31 - }, - "end": { - "line": 65, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 65, - "column": 18 - }, - "end": { - "line": 65, - "column": 42 - } - } - }, - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 65, - "column": 45 - }, - "end": { - "line": 65, - "column": 51 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 65, - "column": 53 - }, - "end": { - "line": 65, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 65, - "column": 44 - }, - "end": { - "line": 65, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 65, - "column": 9 - }, - "end": { - "line": 65, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 65, - "column": 8 - }, - "end": { - "line": 65, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 65, - "column": 5 - }, - "end": { - "line": 65, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 65, - "column": 5 - }, - "end": { - "line": 65, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 65, - "column": 1 - }, - "end": { - "line": 65, - "column": 62 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 66, - "column": 8 - }, - "end": { - "line": 66, - "column": 9 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 66, - "column": 11 - }, - "end": { - "line": 66, - "column": 12 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 66, - "column": 11 - }, - "end": { - "line": 66, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 66, - "column": 10 - }, - "end": { - "line": 66, - "column": 13 - } - } - }, - "returnType": { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 66, - "column": 19 - }, - "end": { - "line": 66, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 10 - }, - "end": { - "line": 66, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 66, - "column": 9 - }, - "end": { - "line": 66, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 8 - }, - "end": { - "line": 66, - "column": 9 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 5 - }, - "end": { - "line": 66, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 66, - "column": 5 - }, - "end": { - "line": 66, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 66, - "column": 1 - }, - "end": { - "line": 66, - "column": 23 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "E", - "loc": { - "start": { - "line": 68, - "column": 6 - }, - "end": { - "line": 68, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 68, - "column": 38 - }, - "end": { - "line": 68, - "column": 44 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 68, - "column": 47 - }, - "end": { - "line": 68, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 68, - "column": 47 - }, - "end": { - "line": 68, - "column": 48 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 68, - "column": 51 - }, - "end": { - "line": 68, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 68, - "column": 38 - }, - "end": { - "line": 68, - "column": 57 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "R", - "loc": { - "start": { - "line": 68, - "column": 8 - }, - "end": { - "line": 68, - "column": 9 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 68, - "column": 18 - }, - "end": { - "line": 68, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 68, - "column": 18 - }, - "end": { - "line": 68, - "column": 19 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 68, - "column": 8 - }, - "end": { - "line": 68, - "column": 20 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "C", - "loc": { - "start": { - "line": 68, - "column": 21 - }, - "end": { - "line": 68, - "column": 22 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 68, - "column": 21 - }, - "end": { - "line": 68, - "column": 23 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 68, - "column": 24 - }, - "end": { - "line": 68, - "column": 25 - } - } - }, - "default": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 68, - "column": 28 - }, - "end": { - "line": 68, - "column": 34 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 68, - "column": 24 - }, - "end": { - "line": 68, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 68, - "column": 7 - }, - "end": { - "line": 68, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 68, - "column": 1 - }, - "end": { - "line": 68, - "column": 58 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 69, - "column": 6 - }, - "end": { - "line": 69, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 69, - "column": 52 - }, - "end": { - "line": 69, - "column": 53 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "K", - "loc": { - "start": { - "line": 69, - "column": 54 - }, - "end": { - "line": 69, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 54 - }, - "end": { - "line": 69, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 52 - }, - "end": { - "line": 69, - "column": 56 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 69, - "column": 57 - }, - "end": { - "line": 69, - "column": 58 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Q", - "loc": { - "start": { - "line": 69, - "column": 59 - }, - "end": { - "line": 69, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 59 - }, - "end": { - "line": 69, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 57 - }, - "end": { - "line": 69, - "column": 61 - } - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 51 - }, - "end": { - "line": 69, - "column": 61 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "K", - "loc": { - "start": { - "line": 69, - "column": 8 - }, - "end": { - "line": 69, - "column": 9 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 69, - "column": 8 - }, - "end": { - "line": 69, - "column": 10 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Q", - "loc": { - "start": { - "line": 69, - "column": 11 - }, - "end": { - "line": 69, - "column": 12 - } - } - }, - "default": { - "type": "TSUnionType", - "types": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 69, - "column": 16 - }, - "end": { - "line": 69, - "column": 22 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 69, - "column": 24 - }, - "end": { - "line": 69, - "column": 30 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 69, - "column": 32 - }, - "end": { - "line": 69, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 15 - }, - "end": { - "line": 69, - "column": 39 - } - } - }, - { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 69, - "column": 42 - }, - "end": { - "line": 69, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 42 - }, - "end": { - "line": 69, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 15 - }, - "end": { - "line": 69, - "column": 47 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 69, - "column": 11 - }, - "end": { - "line": 69, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 7 - }, - "end": { - "line": 69, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 1 - }, - "end": { - "line": 69, - "column": 62 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 6 - } - } - }, - "arguments": [], - "optional": false, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 71, - "column": 8 - }, - "end": { - "line": 71, - "column": 9 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 71, - "column": 8 - }, - "end": { - "line": 71, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 71, - "column": 7 - }, - "end": { - "line": 71, - "column": 10 - } - } - }, - "returnType": { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 71, - "column": 16 - }, - "end": { - "line": 71, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 7 - }, - "end": { - "line": 71, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 71, - "column": 6 - }, - "end": { - "line": 71, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 1 - }, - "end": { - "line": 71, - "column": 22 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "async", - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 6 - } - } - }, - "arguments": [], - "optional": false, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 72, - "column": 7 - }, - "end": { - "line": 72, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 72, - "column": 6 - }, - "end": { - "line": 72, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 1 - }, - "end": { - "line": 72, - "column": 17 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 73, - "column": 17 - }, - "end": { - "line": 73, - "column": 23 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 3 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 73, - "column": 12 - }, - "end": { - "line": 73, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 12 - }, - "end": { - "line": 73, - "column": 13 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 14 - } - } - }, - "body": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 73, - "column": 27 - }, - "end": { - "line": 73, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 73, - "column": 32 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": true, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 74, - "column": 7 - }, - "end": { - "line": 74, - "column": 8 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "readonly", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 74, - "column": 27 - }, - "end": { - "line": 74, - "column": 33 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 74, - "column": 35 - }, - "end": { - "line": 74, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 74, - "column": 26 - }, - "end": { - "line": 74, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 74, - "column": 17 - }, - "end": { - "line": 74, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 74, - "column": 7 - }, - "end": { - "line": 74, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 74, - "column": 6 - }, - "end": { - "line": 74, - "column": 43 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 74, - "column": 57 - }, - "end": { - "line": 74, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 74, - "column": 50 - }, - "end": { - "line": 74, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 74, - "column": 49 - }, - "end": { - "line": 74, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 74, - "column": 1 - }, - "end": { - "line": 74, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 74, - "column": 1 - }, - "end": { - "line": 74, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 74, - "column": 1 - }, - "end": { - "line": 74, - "column": 65 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 74, - "column": 65 - } - } -} diff --git a/es2panda/test/parser/ts/test_generic.ts b/es2panda/test/parser/ts/test_generic.ts deleted file mode 100644 index fa831a127781a3b1f1a36270242347784a1a43a1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_generic.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function func1(arg: Type): Type { - return arg; -} - -function func2() { } - -function func3(a: A, b: string): number | boolean { - return true; -} - -declare type PromiseConstructorLike = new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; - -interface R { - a: number, - [x: string]: boolean | number, -} - -interface U extends R<[number, string]> { - (): number, - readonly(): [boolean, number[]]; -} - -func1() -func2<() => {}>(); - -var o = { - a: function () { }, - b: function () { }, - c() { } -} - -class A { - public a() { }; - private b any[]>() { } -} - -class W extends T< () => number, [number | string][]> { - -} - -class X extends Q implements S<(a:number, b:string) => [number]>, A { - -} - -var a: new () => () => string; -var b: (a: number | string) => { a: number }; - -var c: B.T>>[0]; -var d: A; -var e: T<() => {}>; - -type E = number | T | string; -type P = {a:K, b:Q}; - -async<() => {}>(); -async(); -():number => true; -async() => {return "foo";}; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_import_AssertClause1-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause1-expected.txt deleted file mode 100644 index a23d2c26e00d7a7096b853cb4e4dcd6c18a35dcf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause1-expected.txt +++ /dev/null @@ -1,450 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "ImportExpression", - "source": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "importAssertion": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "assert", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "value": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "k1", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "json", - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "StringLiteral", - "value": "k2", - "loc": { - "start": { - "line": 17, - "column": 40 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "v1", - "loc": { - "start": { - "line": 17, - "column": 46 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 17, - "column": 40 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "k3", - "loc": { - "start": { - "line": 18, - "column": 31 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "k4", - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "xxx", - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 37 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 37 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "value": { - "type": "TemplateLiteral", - "expressions": [], - "quasis": [ - { - "type": "TemplateElement", - "value": { - "raw": "xx", - "cooked": "xx" - }, - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 34 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "k6", - "loc": { - "start": { - "line": 20, - "column": 40 - }, - "end": { - "line": 20, - "column": 42 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "", - "loc": { - "start": { - "line": 20, - "column": 44 - }, - "end": { - "line": 20, - "column": 46 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 40 - }, - "end": { - "line": 20, - "column": 46 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": true, - "key": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 49 - }, - "end": { - "line": 20, - "column": 50 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "xxx", - "loc": { - "start": { - "line": 20, - "column": 53 - }, - "end": { - "line": 20, - "column": 58 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 48 - }, - "end": { - "line": 20, - "column": 58 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 20, - "column": 60 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 20, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 20, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 63 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_import_AssertClause1.ts b/es2panda/test/parser/ts/test_import_AssertClause1.ts deleted file mode 100644 index 2c88ab64db561ea0e0fdc520196b9f7156b17507..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import("test", { assert: { k1: "json", "k2": "v1", - 3: "k3", - k4: "xxx", - type: `xx`, k6: "", [1]: "xxx" }}); diff --git a/es2panda/test/parser/ts/test_import_AssertClause2-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause2-expected.txt deleted file mode 100644 index e17ed57d08f99f73e568678941f65ce8e89c2acf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause2-expected.txt +++ /dev/null @@ -1,222 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "specifiers": [], - "assertClause": { - "type": "AssertClause", - "elements": [ - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key1", - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value1", - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "StringLiteral", - "value": "key2", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value2", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key3", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value3", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 20, - "column": 13 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key4", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value4", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_import_AssertClause2.ts b/es2panda/test/parser/ts/test_import_AssertClause2.ts deleted file mode 100644 index 880153d45cdd63b3e246e3996fcbe9b562d98fc7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import "a" assert { key1: "value1", - "key2": "value2", - key3: - "value3" - , key4: "value4" -}; diff --git a/es2panda/test/parser/ts/test_import_AssertClause3-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause3-expected.txt deleted file mode 100644 index 1b386d5d56c19d098080fdb01894a21f5c3dcf35..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Import assertions cannot be used with type-only imports or exports. [test_import_AssertClause3.ts:17:31] diff --git a/es2panda/test/parser/ts/test_import_AssertClause3.ts b/es2panda/test/parser/ts/test_import_AssertClause3.ts deleted file mode 100644 index adc4dc2ec9a5027f73f060b8a8d1fd9228ebbbde..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import type { a } from "test" assert { key1: "value1"}; diff --git a/es2panda/test/parser/ts/test_import_AssertClause4-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause4-expected.txt deleted file mode 100644 index f2064af3b62dc37da649a8518e764ba064b4f19e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Identifier or string literal expected. [test_import_AssertClause4.ts:17:51] diff --git a/es2panda/test/parser/ts/test_import_AssertClause4.ts b/es2panda/test/parser/ts/test_import_AssertClause4.ts deleted file mode 100644 index 472062ac9701ca84dff6757a02f25b7e56b23691..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause4.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import { a } from "test" assert { key1: "value1", 2: "value2"}; diff --git a/es2panda/test/parser/ts/test_import_AssertClause5-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause5-expected.txt deleted file mode 100644 index 9efa49b499aaefc0cce2e84d16e65ae3482e778d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Import assertion values must be string literal expressions. [test_import_AssertClause5.ts:17:59] diff --git a/es2panda/test/parser/ts/test_import_AssertClause5.ts b/es2panda/test/parser/ts/test_import_AssertClause5.ts deleted file mode 100644 index a753faaa796023ebdcb4e4bfeae500967430278a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import { a } from "test" assert { key1: "value1", "key2": 2}; diff --git a/es2panda/test/parser/ts/test_import_AssertClause6-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause6-expected.txt deleted file mode 100644 index 8d676607f53e010b6423bc2031628cc69e20522c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause6-expected.txt +++ /dev/null @@ -1,477 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "a0", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "imported": { - "type": "Identifier", - "name": "a0", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 12 - } - } - } - ], - "assertClause": { - "type": "AssertClause", - "elements": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "a1", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "imported": { - "type": "Identifier", - "name": "a1", - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "assertClause": { - "type": "AssertClause", - "elements": [ - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key1", - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value1", - "loc": { - "start": { - "line": 19, - "column": 41 - }, - "end": { - "line": 19, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 51 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "a2", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "imported": { - "type": "Identifier", - "name": "a2", - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 12 - } - } - } - ], - "assertClause": { - "type": "AssertClause", - "elements": [ - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key1", - "loc": { - "start": { - "line": 21, - "column": 36 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value1", - "loc": { - "start": { - "line": 21, - "column": 42 - }, - "end": { - "line": 21, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 36 - }, - "end": { - "line": 21, - "column": 50 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "StringLiteral", - "value": "key2", - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value2", - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key3", - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 9 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value3", - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 19 - } - } - }, - { - "type": "AssertEntry", - "key": { - "type": "Identifier", - "name": "key4", - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 25 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "value4", - "loc": { - "start": { - "line": 24, - "column": 27 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 24, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_import_AssertClause6.ts b/es2panda/test/parser/ts/test_import_AssertClause6.ts deleted file mode 100644 index dd5953d4277f9b94bcc28fbbf961ce4ec808b2e4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause6.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import { a0 } from "test" assert {}; - -import { a1 } from "test"assert { key1: "value1"}; - -import { a2 } from "test" assert { key1: "value1" - , "key2" - : "value2", - key3: "value3", key4: "value4"}; diff --git a/es2panda/test/parser/ts/test_import_AssertClause7-expected.txt b/es2panda/test/parser/ts/test_import_AssertClause7-expected.txt deleted file mode 100644 index 3e098cd1cd14a8715e891fb3594243d472b00a6c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause7-expected.txt +++ /dev/null @@ -1,170 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "assert", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "./test", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "imported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "assert", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 7 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 8 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_import_AssertClause7.ts b/es2panda/test/parser/ts/test_import_AssertClause7.ts deleted file mode 100644 index 15fdf707d7e928ffe48a009d5a9a500fa77205b7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_AssertClause7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let assert = 1; -import { a } from "./test" -assert; diff --git a/es2panda/test/parser/ts/test_import_type-expected.txt b/es2panda/test/parser/ts/test_import_type-expected.txt deleted file mode 100644 index def786ea3a4a973c1daadec9455731a1db22d310..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_type-expected.txt +++ /dev/null @@ -1,830 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSImportType", - "parameter": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "tar", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "isTypeOf": false, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSImportType", - "parameter": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "qualifier": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "isTypeOf": false, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSImportType", - "parameter": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "baz", - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "qualifier": { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 21, - "column": 39 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, - "isTypeOf": true, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSImportType", - "parameter": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - "qualifier": { - "type": "TSQualifiedName", - "left": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "r", - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "right": { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, - "right": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, - "isTypeOf": false, - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 24, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSImportType", - "parameter": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 24, - "column": 44 - }, - "end": { - "line": 24, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 44 - }, - "end": { - "line": 24, - "column": 49 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 57 - }, - "end": { - "line": 24, - "column": 63 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 66 - }, - "end": { - "line": 24, - "column": 72 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 57 - }, - "end": { - "line": 24, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 55 - }, - "end": { - "line": 24, - "column": 56 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSImportType", - "parameter": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 24, - "column": 91 - }, - "end": { - "line": 24, - "column": 94 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 91 - }, - "end": { - "line": 24, - "column": 94 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 97 - }, - "end": { - "line": 24, - "column": 103 - } - } - }, - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 105 - }, - "end": { - "line": 24, - "column": 111 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 96 - }, - "end": { - "line": 24, - "column": 112 - } - } - }, - { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 24, - "column": 114 - }, - "end": { - "line": 24, - "column": 116 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 95 - }, - "end": { - "line": 24, - "column": 117 - } - } - }, - "isTypeOf": true, - "loc": { - "start": { - "line": 24, - "column": 77 - }, - "end": { - "line": 24, - "column": 118 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 74 - }, - "end": { - "line": 24, - "column": 75 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 24, - "column": 52 - }, - "end": { - "line": 24, - "column": 53 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 24, - "column": 52 - }, - "end": { - "line": 24, - "column": 54 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 51 - }, - "end": { - "line": 24, - "column": 54 - } - } - }, - "returnType": { - "type": "TSArrayType", - "elementType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 122 - }, - "end": { - "line": 24, - "column": 128 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 122 - }, - "end": { - "line": 24, - "column": 130 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 51 - }, - "end": { - "line": 24, - "column": 130 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 50 - }, - "end": { - "line": 24, - "column": 131 - } - } - }, - "isTypeOf": false, - "loc": { - "start": { - "line": 24, - "column": 37 - }, - "end": { - "line": 24, - "column": 133 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 24, - "column": 132 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 26, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 26, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_import_type.ts b/es2panda/test/parser/ts/test_import_type.ts deleted file mode 100644 index 4300268e7b50587e11cd235bba992e786a9ab40c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_type.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: import("tar"); - -interface B { - k(): import("foo").b; - [x: number]: typeof import("baz").t -} - -function k(a: import("bar").r.t.e): import("foo")<(a:number | string, b: typeof import("a")<[number, string], {}>) => number[]> { - -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_import_type2-expected.txt b/es2panda/test/parser/ts/test_import_type2-expected.txt deleted file mode 100644 index 398537a402342b2a83cb899644db95c518c05b7a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_type2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: The type modifier cannot be used on a named import when 'import type' is used on its import statement. [test_import_type2.ts:17:23] diff --git a/es2panda/test/parser/ts/test_import_type2.ts b/es2panda/test/parser/ts/test_import_type2.ts deleted file mode 100644 index 04004be8312904b3334a6c0c484c59db1e45290d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_type2.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import type { a, type b } from 'file'; diff --git a/es2panda/test/parser/ts/test_import_type3-expected.txt b/es2panda/test/parser/ts/test_import_type3-expected.txt deleted file mode 100644 index 3f90b36fc97abff01c0f032d1f138e763e5d0a84..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_type3-expected.txt +++ /dev/null @@ -1,170 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ImportDeclaration", - "source": { - "type": "StringLiteral", - "value": "file", - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - "specifiers": [ - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "imported": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "imported": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "isType": false, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - { - "type": "ImportSpecifier", - "local": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "imported": { - "type": "Identifier", - "name": "type", - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "isType": true, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_import_type3.ts b/es2panda/test/parser/ts/test_import_type3.ts deleted file mode 100644 index 254a72779452a27ce7439da9063b832d9ce44e77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_import_type3.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import { a, type, type type } from 'file'; diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends1-expected.txt b/es2panda/test/parser/ts/test_infer-type-with-extends1-expected.txt deleted file mode 100644 index eb9692c8bbb50e262f3c194260c1ce50b15e8421..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends1-expected.txt +++ /dev/null @@ -1,3946 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "extendsType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 46 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 55 - }, - "end": { - "line": 18, - "column": 61 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 38 - }, - "end": { - "line": 18, - "column": 62 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 18, - "column": 66 - }, - "end": { - "line": 18, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 66 - }, - "end": { - "line": 18, - "column": 74 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 18, - "column": 76 - }, - "end": { - "line": 18, - "column": 77 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 76 - }, - "end": { - "line": 18, - "column": 77 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 65 - }, - "end": { - "line": 18, - "column": 78 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 19, - "column": 43 - }, - "end": { - "line": 19, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 43 - }, - "end": { - "line": 19, - "column": 51 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 53 - }, - "end": { - "line": 19, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 53 - }, - "end": { - "line": 19, - "column": 54 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 42 - }, - "end": { - "line": 19, - "column": 55 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "constraint": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X1_T1", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X1_T2", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X1_T3", - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 47 - }, - "end": { - "line": 27, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 47 - }, - "end": { - "line": 27, - "column": 48 - } - } - }, - "extendsType": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 27, - "column": 67 - }, - "end": { - "line": 27, - "column": 68 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 77 - }, - "end": { - "line": 27, - "column": 83 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 67 - }, - "end": { - "line": 27, - "column": 84 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 61 - }, - "end": { - "line": 27, - "column": 84 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 58 - }, - "end": { - "line": 27, - "column": 59 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 27, - "column": 88 - }, - "end": { - "line": 27, - "column": 92 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 57 - }, - "end": { - "line": 27, - "column": 92 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 27, - "column": 96 - }, - "end": { - "line": 27, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 96 - }, - "end": { - "line": 27, - "column": 104 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 27, - "column": 106 - }, - "end": { - "line": 27, - "column": 107 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 106 - }, - "end": { - "line": 27, - "column": 107 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 95 - }, - "end": { - "line": 27, - "column": 108 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 28, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 28, - "column": 25 - }, - "end": { - "line": 28, - "column": 26 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 28, - "column": 35 - }, - "end": { - "line": 28, - "column": 41 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 28, - "column": 25 - }, - "end": { - "line": 28, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 16 - }, - "end": { - "line": 28, - "column": 17 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 28, - "column": 46 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 50 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 28, - "column": 54 - }, - "end": { - "line": 28, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 54 - }, - "end": { - "line": 28, - "column": 62 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 28, - "column": 64 - }, - "end": { - "line": 28, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 64 - }, - "end": { - "line": 28, - "column": 65 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 53 - }, - "end": { - "line": 28, - "column": 66 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 5 - }, - "end": { - "line": 29, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 47 - }, - "end": { - "line": 29, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - "constraint": { - "type": "TSFunctionType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 27, - "column": 29 - }, - "end": { - "line": 27, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 29 - }, - "end": { - "line": 27, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 27, - "column": 39 - }, - "end": { - "line": 27, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 43 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 8 - }, - "end": { - "line": 27, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 29, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X2_T1", - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 31, - "column": 21 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 21 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 31, - "column": 29 - }, - "end": { - "line": 31, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 31, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X2_T2", - "loc": { - "start": { - "line": 32, - "column": 6 - }, - "end": { - "line": 32, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 32, - "column": 14 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 32, - "column": 21 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 21 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 32, - "column": 27 - }, - "end": { - "line": 32, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 32, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 14 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X2_T3", - "loc": { - "start": { - "line": 33, - "column": 6 - }, - "end": { - "line": 33, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 19 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 33, - "column": 32 - }, - "end": { - "line": 33, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 17 - }, - "end": { - "line": 33, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 16 - }, - "end": { - "line": 33, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 38 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T3", - "loc": { - "start": { - "line": 36, - "column": 6 - }, - "end": { - "line": 36, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSFunctionType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 37, - "column": 25 - }, - "end": { - "line": 37, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 25 - }, - "end": { - "line": 37, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 19 - }, - "end": { - "line": 37, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 16 - }, - "end": { - "line": 37, - "column": 23 - } - } - } - ], - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 37, - "column": 42 - }, - "end": { - "line": 37, - "column": 43 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 37, - "column": 52 - }, - "end": { - "line": 37, - "column": 58 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 37, - "column": 42 - }, - "end": { - "line": 37, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 36 - }, - "end": { - "line": 37, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 35 - }, - "end": { - "line": 37, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 15 - }, - "end": { - "line": 37, - "column": 59 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 37, - "column": 63 - }, - "end": { - "line": 37, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 63 - }, - "end": { - "line": 37, - "column": 71 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 37, - "column": 73 - }, - "end": { - "line": 37, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 73 - }, - "end": { - "line": 37, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 37, - "column": 62 - }, - "end": { - "line": 37, - "column": 75 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 38, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSFunctionType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 38, - "column": 25 - }, - "end": { - "line": 38, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 25 - }, - "end": { - "line": 38, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 19 - }, - "end": { - "line": 38, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 38, - "column": 23 - } - } - } - ], - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 38, - "column": 42 - }, - "end": { - "line": 38, - "column": 43 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 38, - "column": 52 - }, - "end": { - "line": 38, - "column": 58 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 38, - "column": 42 - }, - "end": { - "line": 38, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 36 - }, - "end": { - "line": 38, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 35 - }, - "end": { - "line": 38, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 15 - }, - "end": { - "line": 38, - "column": 59 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 38, - "column": 63 - }, - "end": { - "line": 38, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 63 - }, - "end": { - "line": 38, - "column": 71 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 38, - "column": 73 - }, - "end": { - "line": 38, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 73 - }, - "end": { - "line": 38, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 62 - }, - "end": { - "line": 38, - "column": 75 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 5 - }, - "end": { - "line": 39, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 39, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 10 - } - } - }, - "constraint": { - "type": "TSFunctionType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 36, - "column": 29 - }, - "end": { - "line": 36, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 29 - }, - "end": { - "line": 36, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 23 - }, - "end": { - "line": 36, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 20 - }, - "end": { - "line": 36, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 36, - "column": 39 - }, - "end": { - "line": 36, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 19 - }, - "end": { - "line": 36, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 39, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X3_T1", - "loc": { - "start": { - "line": 41, - "column": 6 - }, - "end": { - "line": 41, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T3", - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "returnType": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 41, - "column": 23 - }, - "end": { - "line": 41, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 23 - }, - "end": { - "line": 41, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 17 - }, - "end": { - "line": 41, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 16 - }, - "end": { - "line": 41, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 1 - }, - "end": { - "line": 41, - "column": 28 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X3_T2", - "loc": { - "start": { - "line": 42, - "column": 6 - }, - "end": { - "line": 42, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T3", - "loc": { - "start": { - "line": 42, - "column": 14 - }, - "end": { - "line": 42, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "returnType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 42, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 42, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 17 - }, - "end": { - "line": 42, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 16 - }, - "end": { - "line": 42, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 14 - }, - "end": { - "line": 42, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 42, - "column": 26 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X3_T3", - "loc": { - "start": { - "line": 43, - "column": 6 - }, - "end": { - "line": 43, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T3", - "loc": { - "start": { - "line": 43, - "column": 14 - }, - "end": { - "line": 43, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSFunctionType", - "params": [], - "returnType": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 43, - "column": 23 - }, - "end": { - "line": 43, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 43, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 43, - "column": 16 - }, - "end": { - "line": 43, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 14 - }, - "end": { - "line": 43, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 1 - }, - "end": { - "line": 43, - "column": 31 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T4", - "loc": { - "start": { - "line": 46, - "column": 6 - }, - "end": { - "line": 46, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 47, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSConstructorType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 47, - "column": 29 - }, - "end": { - "line": 47, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 29 - }, - "end": { - "line": 47, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 23 - }, - "end": { - "line": 47, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 20 - }, - "end": { - "line": 47, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 47, - "column": 46 - }, - "end": { - "line": 47, - "column": 47 - } - } - }, - "constraint": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 47, - "column": 58 - }, - "end": { - "line": 47, - "column": 59 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 47, - "column": 61 - }, - "end": { - "line": 47, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 58 - }, - "end": { - "line": 47, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 47, - "column": 56 - }, - "end": { - "line": 47, - "column": 69 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 47, - "column": 46 - }, - "end": { - "line": 47, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 40 - }, - "end": { - "line": 47, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 39 - }, - "end": { - "line": 47, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 15 - }, - "end": { - "line": 47, - "column": 70 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 47, - "column": 74 - }, - "end": { - "line": 47, - "column": 82 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 74 - }, - "end": { - "line": 47, - "column": 82 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 47, - "column": 84 - }, - "end": { - "line": 47, - "column": 85 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 84 - }, - "end": { - "line": 47, - "column": 85 - } - } - } - ], - "loc": { - "start": { - "line": 47, - "column": 73 - }, - "end": { - "line": 47, - "column": 86 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 48, - "column": 5 - }, - "end": { - "line": 48, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 5 - }, - "end": { - "line": 48, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSConstructorType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 48, - "column": 29 - }, - "end": { - "line": 48, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 29 - }, - "end": { - "line": 48, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 23 - }, - "end": { - "line": 48, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 27 - } - } - } - ], - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 48, - "column": 46 - }, - "end": { - "line": 48, - "column": 47 - } - } - }, - "constraint": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 48, - "column": 58 - }, - "end": { - "line": 48, - "column": 59 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 48, - "column": 61 - }, - "end": { - "line": 48, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 58 - }, - "end": { - "line": 48, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 48, - "column": 56 - }, - "end": { - "line": 48, - "column": 69 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 48, - "column": 46 - }, - "end": { - "line": 48, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 40 - }, - "end": { - "line": 48, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 39 - }, - "end": { - "line": 48, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 15 - }, - "end": { - "line": 48, - "column": 70 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 48, - "column": 74 - }, - "end": { - "line": 48, - "column": 82 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 74 - }, - "end": { - "line": 48, - "column": 82 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 48, - "column": 84 - }, - "end": { - "line": 48, - "column": 85 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 84 - }, - "end": { - "line": 48, - "column": 85 - } - } - } - ], - "loc": { - "start": { - "line": 48, - "column": 73 - }, - "end": { - "line": 48, - "column": 86 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 49, - "column": 5 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 5 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 5 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 46, - "column": 9 - }, - "end": { - "line": 46, - "column": 10 - } - } - }, - "constraint": { - "type": "TSConstructorType", - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 46, - "column": 33 - }, - "end": { - "line": 46, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 33 - }, - "end": { - "line": 46, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 27 - }, - "end": { - "line": 46, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 24 - }, - "end": { - "line": 46, - "column": 31 - } - } - } - ], - "returnType": { - "type": "TSAnyKeyword", - "loc": { - "start": { - "line": 46, - "column": 43 - }, - "end": { - "line": 46, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 19 - }, - "end": { - "line": 46, - "column": 46 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 46, - "column": 9 - }, - "end": { - "line": 46, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 8 - }, - "end": { - "line": 46, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 1 - }, - "end": { - "line": 49, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X4_T1", - "loc": { - "start": { - "line": 51, - "column": 6 - }, - "end": { - "line": 51, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T4", - "loc": { - "start": { - "line": 51, - "column": 14 - }, - "end": { - "line": 51, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSConstructorType", - "params": [], - "returnType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 51, - "column": 29 - }, - "end": { - "line": 51, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 51, - "column": 32 - }, - "end": { - "line": 51, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 32 - }, - "end": { - "line": 51, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 29 - }, - "end": { - "line": 51, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 51, - "column": 27 - }, - "end": { - "line": 51, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 17 - }, - "end": { - "line": 51, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 51, - "column": 16 - }, - "end": { - "line": 51, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 14 - }, - "end": { - "line": 51, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 1 - }, - "end": { - "line": 51, - "column": 39 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X4_T2", - "loc": { - "start": { - "line": 52, - "column": 6 - }, - "end": { - "line": 52, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T4", - "loc": { - "start": { - "line": 52, - "column": 14 - }, - "end": { - "line": 52, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSConstructorType", - "params": [], - "returnType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 52, - "column": 29 - }, - "end": { - "line": 52, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 52, - "column": 32 - }, - "end": { - "line": 52, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 32 - }, - "end": { - "line": 52, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 29 - }, - "end": { - "line": 52, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 52, - "column": 27 - }, - "end": { - "line": 52, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 17 - }, - "end": { - "line": 52, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 52, - "column": 16 - }, - "end": { - "line": 52, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 14 - }, - "end": { - "line": 52, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 1 - }, - "end": { - "line": 52, - "column": 37 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X4_T3", - "loc": { - "start": { - "line": 53, - "column": 6 - }, - "end": { - "line": 53, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T4", - "loc": { - "start": { - "line": 53, - "column": 14 - }, - "end": { - "line": 53, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSConstructorType", - "params": [], - "returnType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 53, - "column": 29 - }, - "end": { - "line": 53, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 53, - "column": 32 - }, - "end": { - "line": 53, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 29 - }, - "end": { - "line": 53, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 27 - }, - "end": { - "line": 53, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 17 - }, - "end": { - "line": 53, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 53, - "column": 16 - }, - "end": { - "line": 53, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 14 - }, - "end": { - "line": 53, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 1 - }, - "end": { - "line": 53, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 54, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends1.ts b/es2panda/test/parser/ts/test_infer-type-with-extends1.ts deleted file mode 100644 index 55fceebe931ec72787d2d79f820394222a822917..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends1.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// infer to tuple element -type T1 = T extends [infer U extends string] ? ["string", U] : - T extends [infer U extends number] ? ["number", U] : - never; - -type X1_T1 = T1<["a"]>; // ["string", "a"] -type X1_T2 = T1<[1]>; // ["number", 1] -type X1_T3 = T1<[object]>; // never - -// infer to argument -type T2 void> = T extends (a: infer U extends string) => void ? ["string", U] : - T extends (a: infer U extends number) => void ? ["number", U] : - never; - -type X2_T1 = T2<(a: "a") => void>; // ["string", "a"] -type X2_T2 = T2<(a: 1) => void>; // ["number", 1] -type X2_T3 = T2<(a: object) => void>; // never - -// infer to return type -type T3 any> = - T extends (...args: any[]) => (infer U extends string) ? ["string", U] : - T extends (...args: any[]) => (infer U extends number) ? ["number", U] : - never; - -type X3_T1 = T3<() => "a">; // ["string", "a"] -type X3_T2 = T3<() => 1>; // ["number", 1] -type X3_T3 = T3<() => object>; // never - -// infer to instance type -type T4 any> = - T extends new (...args: any[]) => (infer U extends { a: string }) ? ["string", U] : - T extends new (...args: any[]) => (infer U extends { a: number }) ? ["number", U] : - never; - -type X4_T1 = T4 { a: "a" }>; // ["string", { a: "a" }] -type X4_T2 = T4 { a: 1 }>; // ["number", { a: 1 }] -type X4_T3 = T4 { a: object }>; // never diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends2-expected.txt b/es2panda/test/parser/ts/test_infer-type-with-extends2-expected.txt deleted file mode 100644 index 7bf07a42da64c194910aefc8df757450fc982065..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends2-expected.txt +++ /dev/null @@ -1,2634 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T5", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 39 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 19, - "column": 60 - }, - "end": { - "line": 19, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 60 - }, - "end": { - "line": 19, - "column": 61 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 49 - }, - "end": { - "line": 19, - "column": 62 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 39 - }, - "end": { - "line": 20, - "column": 45 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 20, - "column": 50 - }, - "end": { - "line": 20, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 50 - }, - "end": { - "line": 20, - "column": 58 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 20, - "column": 60 - }, - "end": { - "line": 20, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 60 - }, - "end": { - "line": 20, - "column": 61 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 49 - }, - "end": { - "line": 20, - "column": 62 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 21, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X5_T1", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T5", - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 23, - "column": 31 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 31 - }, - "end": { - "line": 23, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 24 - }, - "end": { - "line": 23, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 16 - }, - "end": { - "line": 23, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X5_T2", - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T5", - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 24 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X5_T3", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T5", - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Promise", - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "BigIntLiteral", - "value": "1n", - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "BigIntLiteral", - "value": "2n", - "loc": { - "start": { - "line": 25, - "column": 30 - }, - "end": { - "line": 25, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 30 - }, - "end": { - "line": 25, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 24 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 16 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 35 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T6", - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 27 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 29, - "column": 36 - }, - "end": { - "line": 29, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 44 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 29, - "column": 48 - }, - "end": { - "line": 29, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 48 - }, - "end": { - "line": 29, - "column": 56 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 29, - "column": 58 - }, - "end": { - "line": 29, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 58 - }, - "end": { - "line": 29, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 47 - }, - "end": { - "line": 29, - "column": 60 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 30, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 30, - "column": 26 - }, - "end": { - "line": 30, - "column": 27 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 30, - "column": 36 - }, - "end": { - "line": 30, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 30, - "column": 26 - }, - "end": { - "line": 30, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 30, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 15 - }, - "end": { - "line": 30, - "column": 44 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 30, - "column": 48 - }, - "end": { - "line": 30, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 48 - }, - "end": { - "line": 30, - "column": 56 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 30, - "column": 58 - }, - "end": { - "line": 30, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 58 - }, - "end": { - "line": 30, - "column": 59 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 47 - }, - "end": { - "line": 30, - "column": 60 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5 - }, - "end": { - "line": 31, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 31, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 28, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 31, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X6_T1", - "loc": { - "start": { - "line": 33, - "column": 6 - }, - "end": { - "line": 33, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T6", - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 33, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 33, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 33, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 33, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 17 - }, - "end": { - "line": 33, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 16 - }, - "end": { - "line": 33, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 29 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X6_T2", - "loc": { - "start": { - "line": 34, - "column": 6 - }, - "end": { - "line": 34, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T6", - "loc": { - "start": { - "line": 34, - "column": 14 - }, - "end": { - "line": 34, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 34, - "column": 19 - }, - "end": { - "line": 34, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 34, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 19 - }, - "end": { - "line": 34, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 34, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 14 - }, - "end": { - "line": 34, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 34, - "column": 27 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X6_T3", - "loc": { - "start": { - "line": 35, - "column": 6 - }, - "end": { - "line": 35, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T6", - "loc": { - "start": { - "line": 35, - "column": 14 - }, - "end": { - "line": 35, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 35, - "column": 19 - }, - "end": { - "line": 35, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 35, - "column": 22 - }, - "end": { - "line": 35, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 19 - }, - "end": { - "line": 35, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 16 - }, - "end": { - "line": 35, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 14 - }, - "end": { - "line": 35, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 1 - }, - "end": { - "line": 35, - "column": 32 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 38, - "column": 6 - }, - "end": { - "line": 38, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 39, - "column": 26 - }, - "end": { - "line": 39, - "column": 27 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 39, - "column": 36 - }, - "end": { - "line": 39, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 39, - "column": 26 - }, - "end": { - "line": 39, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 20 - }, - "end": { - "line": 39, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 43 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 39, - "column": 44 - }, - "end": { - "line": 39, - "column": 45 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 39, - "column": 53 - }, - "end": { - "line": 39, - "column": 54 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 39, - "column": 63 - }, - "end": { - "line": 39, - "column": 69 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 39, - "column": 53 - }, - "end": { - "line": 39, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 47 - }, - "end": { - "line": 39, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 44 - }, - "end": { - "line": 39, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 15 - }, - "end": { - "line": 39, - "column": 71 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 39, - "column": 75 - }, - "end": { - "line": 39, - "column": 83 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 75 - }, - "end": { - "line": 39, - "column": 83 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 39, - "column": 85 - }, - "end": { - "line": 39, - "column": 86 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 85 - }, - "end": { - "line": 39, - "column": 86 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 74 - }, - "end": { - "line": 39, - "column": 87 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 40, - "column": 17 - }, - "end": { - "line": 40, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 40, - "column": 26 - }, - "end": { - "line": 40, - "column": 27 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 40, - "column": 36 - }, - "end": { - "line": 40, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 40, - "column": 26 - }, - "end": { - "line": 40, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 20 - }, - "end": { - "line": 40, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 17 - }, - "end": { - "line": 40, - "column": 43 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 40, - "column": 44 - }, - "end": { - "line": 40, - "column": 45 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 40, - "column": 53 - }, - "end": { - "line": 40, - "column": 54 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 40, - "column": 63 - }, - "end": { - "line": 40, - "column": 69 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 40, - "column": 53 - }, - "end": { - "line": 40, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 47 - }, - "end": { - "line": 40, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 44 - }, - "end": { - "line": 40, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 15 - }, - "end": { - "line": 40, - "column": 71 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 40, - "column": 75 - }, - "end": { - "line": 40, - "column": 83 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 75 - }, - "end": { - "line": 40, - "column": 83 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 40, - "column": 85 - }, - "end": { - "line": 40, - "column": 86 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 85 - }, - "end": { - "line": 40, - "column": 86 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 74 - }, - "end": { - "line": 40, - "column": 87 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 41, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 41, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 38, - "column": 8 - }, - "end": { - "line": 38, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 1 - }, - "end": { - "line": 41, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 42, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends2.ts b/es2panda/test/parser/ts/test_infer-type-with-extends2.ts deleted file mode 100644 index dc6a835c3114eda720c7d7809a55b632ef98eaa2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends2.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// infer to type argument -type T5 = - T extends Promise ? ["string", U] : - T extends Promise ? ["number", U] : - never; - -type X5_T1 = T5>; // ["string", "a" | "b"] -type X5_T2 = T5>; // ["number", 1 | 2] -type X5_T3 = T5>; // never - -// infer to property type -type T6 = - T extends { a: infer U extends string } ? ["string", U] : - T extends { a: infer U extends number } ? ["number", U] : - never; - -type X6_T1 = T6<{ a: "a" }>; // ["string", "a"] -type X6_T2 = T6<{ a: 1 }>; // ["number", 1] -type X6_T3 = T6<{ a: object }>; // never - -// infer twice with same constraint -type T7 = - T extends { a: infer U extends string, b: infer U extends string } ? ["string", U] : - T extends { a: infer U extends number, b: infer U extends number } ? ["number", U] : - never; diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends3-expected.txt b/es2panda/test/parser/ts/test_infer-type-with-extends3-expected.txt deleted file mode 100644 index bc29a6fb56ad321aff6fada74fefc4e351c30bec..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends3-expected.txt +++ /dev/null @@ -1,3599 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X7_T1", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X7_T2", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X7_T3", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 31 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X7_T4", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T7", - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 20, - "column": 27 - }, - "end": { - "line": 20, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 27 - }, - "end": { - "line": 20, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T8", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 36 - }, - "end": { - "line": 24, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 43 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 24, - "column": 44 - }, - "end": { - "line": 24, - "column": 45 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 24, - "column": 53 - }, - "end": { - "line": 24, - "column": 54 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 24, - "column": 53 - }, - "end": { - "line": 24, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 47 - }, - "end": { - "line": 24, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 44 - }, - "end": { - "line": 24, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 56 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 24, - "column": 60 - }, - "end": { - "line": 24, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 60 - }, - "end": { - "line": 24, - "column": 68 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 24, - "column": 70 - }, - "end": { - "line": 24, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 70 - }, - "end": { - "line": 24, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 59 - }, - "end": { - "line": 24, - "column": 72 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 36 - }, - "end": { - "line": 25, - "column": 42 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 20 - }, - "end": { - "line": 25, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 43 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 25, - "column": 44 - }, - "end": { - "line": 25, - "column": 45 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 53 - }, - "end": { - "line": 25, - "column": 54 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 53 - }, - "end": { - "line": 25, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 47 - }, - "end": { - "line": 25, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 44 - }, - "end": { - "line": 25, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 56 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 25, - "column": 60 - }, - "end": { - "line": 25, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 60 - }, - "end": { - "line": 25, - "column": 68 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 70 - }, - "end": { - "line": 25, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 70 - }, - "end": { - "line": 25, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 59 - }, - "end": { - "line": 25, - "column": 72 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 8 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X8_T1", - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T8", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 26 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 28, - "column": 27 - }, - "end": { - "line": 28, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 28, - "column": 30 - }, - "end": { - "line": 28, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 30 - }, - "end": { - "line": 28, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 27 - }, - "end": { - "line": 28, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 16 - }, - "end": { - "line": 28, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 37 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X8_T2", - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T8", - "loc": { - "start": { - "line": 29, - "column": 14 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 29, - "column": 25 - }, - "end": { - "line": 29, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 29, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 29, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 25 - }, - "end": { - "line": 29, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 14 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 29, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X8_T3", - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T8", - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 30, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 30, - "column": 22 - }, - "end": { - "line": 30, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 29 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 30, - "column": 30 - }, - "end": { - "line": 30, - "column": 31 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 30, - "column": 33 - }, - "end": { - "line": 30, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 30 - }, - "end": { - "line": 30, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 16 - }, - "end": { - "line": 30, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 30, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 43 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X8_T4", - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T8", - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 19 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 31, - "column": 27 - }, - "end": { - "line": 31, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 31, - "column": 30 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 30 - }, - "end": { - "line": 31, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 27 - }, - "end": { - "line": 31, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 31, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T9", - "loc": { - "start": { - "line": 34, - "column": 6 - }, - "end": { - "line": 34, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 35, - "column": 26 - }, - "end": { - "line": 35, - "column": 27 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 35, - "column": 26 - }, - "end": { - "line": 35, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 20 - }, - "end": { - "line": 35, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 28 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 35, - "column": 29 - }, - "end": { - "line": 35, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 35, - "column": 38 - }, - "end": { - "line": 35, - "column": 39 - } - } - }, - "constraint": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 35, - "column": 48 - }, - "end": { - "line": 35, - "column": 54 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 35, - "column": 38 - }, - "end": { - "line": 35, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 32 - }, - "end": { - "line": 35, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 29 - }, - "end": { - "line": 35, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 15 - }, - "end": { - "line": 35, - "column": 56 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "string", - "loc": { - "start": { - "line": 35, - "column": 60 - }, - "end": { - "line": 35, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 60 - }, - "end": { - "line": 35, - "column": 68 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 35, - "column": 70 - }, - "end": { - "line": 35, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 70 - }, - "end": { - "line": 35, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 59 - }, - "end": { - "line": 35, - "column": 72 - } - } - }, - "falseType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 6 - } - } - }, - "extendsType": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 36, - "column": 17 - }, - "end": { - "line": 36, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 36, - "column": 26 - }, - "end": { - "line": 36, - "column": 27 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 36, - "column": 26 - }, - "end": { - "line": 36, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 20 - }, - "end": { - "line": 36, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 17 - }, - "end": { - "line": 36, - "column": 28 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 36, - "column": 29 - }, - "end": { - "line": 36, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 36, - "column": 38 - }, - "end": { - "line": 36, - "column": 39 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 36, - "column": 48 - }, - "end": { - "line": 36, - "column": 54 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 36, - "column": 38 - }, - "end": { - "line": 36, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 32 - }, - "end": { - "line": 36, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 29 - }, - "end": { - "line": 36, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 15 - }, - "end": { - "line": 36, - "column": 56 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "number", - "loc": { - "start": { - "line": 36, - "column": 60 - }, - "end": { - "line": 36, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 60 - }, - "end": { - "line": 36, - "column": 68 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 36, - "column": 70 - }, - "end": { - "line": 36, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 70 - }, - "end": { - "line": 36, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 59 - }, - "end": { - "line": 36, - "column": 72 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 37, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 37, - "column": 10 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 10 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 8 - }, - "end": { - "line": 34, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 37, - "column": 11 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X9_T1", - "loc": { - "start": { - "line": 39, - "column": 6 - }, - "end": { - "line": 39, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T9", - "loc": { - "start": { - "line": 39, - "column": 14 - }, - "end": { - "line": 39, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 39, - "column": 19 - }, - "end": { - "line": 39, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 39, - "column": 22 - }, - "end": { - "line": 39, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 22 - }, - "end": { - "line": 39, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 19 - }, - "end": { - "line": 39, - "column": 26 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 39, - "column": 27 - }, - "end": { - "line": 39, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 39, - "column": 30 - }, - "end": { - "line": 39, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 30 - }, - "end": { - "line": 39, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 27 - }, - "end": { - "line": 39, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 16 - }, - "end": { - "line": 39, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 14 - }, - "end": { - "line": 39, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 1 - }, - "end": { - "line": 39, - "column": 37 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X9_T2", - "loc": { - "start": { - "line": 40, - "column": 6 - }, - "end": { - "line": 40, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T9", - "loc": { - "start": { - "line": 40, - "column": 14 - }, - "end": { - "line": 40, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 40, - "column": 19 - }, - "end": { - "line": 40, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 40, - "column": 22 - }, - "end": { - "line": 40, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 22 - }, - "end": { - "line": 40, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 19 - }, - "end": { - "line": 40, - "column": 24 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 40, - "column": 25 - }, - "end": { - "line": 40, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 40, - "column": 28 - }, - "end": { - "line": 40, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 28 - }, - "end": { - "line": 40, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 25 - }, - "end": { - "line": 40, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 17 - }, - "end": { - "line": 40, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 16 - }, - "end": { - "line": 40, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 14 - }, - "end": { - "line": 40, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X9_T3", - "loc": { - "start": { - "line": 41, - "column": 6 - }, - "end": { - "line": 41, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T9", - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 41, - "column": 19 - }, - "end": { - "line": 41, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 41, - "column": 22 - }, - "end": { - "line": 41, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 19 - }, - "end": { - "line": 41, - "column": 29 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 41, - "column": 30 - }, - "end": { - "line": 41, - "column": 31 - } - } - }, - "typeAnnotation": { - "type": "TSObjectKeyword", - "loc": { - "start": { - "line": 41, - "column": 33 - }, - "end": { - "line": 41, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 30 - }, - "end": { - "line": 41, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 17 - }, - "end": { - "line": 41, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 16 - }, - "end": { - "line": 41, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 14 - }, - "end": { - "line": 41, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 1 - }, - "end": { - "line": 41, - "column": 43 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X9_T4", - "loc": { - "start": { - "line": 42, - "column": 6 - }, - "end": { - "line": 42, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T9", - "loc": { - "start": { - "line": 42, - "column": 14 - }, - "end": { - "line": 42, - "column": 16 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 42, - "column": 19 - }, - "end": { - "line": 42, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 42, - "column": 22 - }, - "end": { - "line": 42, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 22 - }, - "end": { - "line": 42, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 19 - }, - "end": { - "line": 42, - "column": 26 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 42, - "column": 27 - }, - "end": { - "line": 42, - "column": 28 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 42, - "column": 30 - }, - "end": { - "line": 42, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 30 - }, - "end": { - "line": 42, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 27 - }, - "end": { - "line": 42, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 17 - }, - "end": { - "line": 42, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 16 - }, - "end": { - "line": 42, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 14 - }, - "end": { - "line": 42, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 42, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 43, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends3.ts b/es2panda/test/parser/ts/test_infer-type-with-extends3.ts deleted file mode 100644 index a1e5585aeb33263772f27fe06b7af2069c60d513..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends3.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type X7_T1 = T7<{ a: "a", b: "b" }>; // ["string", "a" | "b"] -type X7_T2 = T7<{ a: 1, b: 2 }>; // ["number", 1 | 2] -type X7_T3 = T7<{ a: object, b: object }>; // never -type X7_T4 = T7<{ a: "a", b: 1 }>; // never - -// infer twice with missing second constraint (same behavior as class/interface) -type T8 = - T extends { a: infer U extends string, b: infer U } ? ["string", U] : - T extends { a: infer U extends number, b: infer U } ? ["number", U] : - never; - -type X8_T1 = T8<{ a: "a", b: "b" }>; // ["string", "a" | "b"] -type X8_T2 = T8<{ a: 1, b: 2 }>; // ["number", 1 | 2] -type X8_T3 = T8<{ a: object, b: object }>; // never -type X8_T4 = T8<{ a: "a", b: 1 }>; // never - -// infer twice with missing first constraint (same behavior as class/interface) -type T9 = - T extends { a: infer U, b: infer U extends string } ? ["string", U] : - T extends { a: infer U, b: infer U extends number } ? ["number", U] : - never; - -type X9_T1 = T9<{ a: "a", b: "b" }>; // ["string", "a" | "b"] -type X9_T2 = T9<{ a: 1, b: 2 }>; // ["number", 1 | 2] -type X9_T3 = T9<{ a: object, b: object }>; // never -type X9_T4 = T9<{ a: "a", b: 1 }>; // never diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends4-expected.txt b/es2panda/test/parser/ts/test_infer-type-with-extends4-expected.txt deleted file mode 100644 index e8bce8ad39526983a5f2e64757ceddc44ea20ba2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends4-expected.txt +++ /dev/null @@ -1,3073 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T10", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "extendsType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 42 - }, - "end": { - "line": 18, - "column": 48 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 51 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 51 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 55 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 55 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 57 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 60 - }, - "end": { - "line": 18, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 60 - }, - "end": { - "line": 18, - "column": 61 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 18, - "column": 64 - }, - "end": { - "line": 18, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 64 - }, - "end": { - "line": 18, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 65 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 66 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X10_Y1", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T10", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "extendsType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 41 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 41 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 19, - "column": 45 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 45 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 48 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X10_T1_T1", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "X10_Y1", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 20, - "column": 25 - }, - "end": { - "line": 20, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 24 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T11", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 22, - "column": 33 - }, - "end": { - "line": 22, - "column": 34 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 33 - }, - "end": { - "line": 22, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 35 - } - } - }, - "extendsType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 44 - }, - "end": { - "line": 22, - "column": 50 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 53 - }, - "end": { - "line": 22, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 53 - }, - "end": { - "line": 22, - "column": 54 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 22, - "column": 57 - }, - "end": { - "line": 22, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 57 - }, - "end": { - "line": 22, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 59 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 22, - "column": 62 - }, - "end": { - "line": 22, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 62 - }, - "end": { - "line": 22, - "column": 63 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 22, - "column": 66 - }, - "end": { - "line": 22, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 66 - }, - "end": { - "line": 22, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 67 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 68 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T12", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 23, - "column": 32 - }, - "end": { - "line": 23, - "column": 33 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 42 - }, - "end": { - "line": 23, - "column": 48 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 23, - "column": 32 - }, - "end": { - "line": 23, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 26 - }, - "end": { - "line": 23, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 49 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 52 - }, - "end": { - "line": 23, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 52 - }, - "end": { - "line": 23, - "column": 53 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 23, - "column": 56 - }, - "end": { - "line": 23, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 56 - }, - "end": { - "line": 23, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 57 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 58 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T13", - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 24, - "column": 41 - }, - "end": { - "line": 24, - "column": 47 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 49 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 24, - "column": 50 - }, - "end": { - "line": 24, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 50 - }, - "end": { - "line": 24, - "column": 51 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 24, - "column": 54 - }, - "end": { - "line": 24, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 54 - }, - "end": { - "line": 24, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 15 - }, - "end": { - "line": 24, - "column": 55 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 56 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T14", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 37 - }, - "end": { - "line": 25, - "column": 38 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 47 - }, - "end": { - "line": 25, - "column": 53 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 37 - }, - "end": { - "line": 25, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 31 - }, - "end": { - "line": 25, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 25 - }, - "end": { - "line": 25, - "column": 55 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 25, - "column": 56 - }, - "end": { - "line": 25, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 56 - }, - "end": { - "line": 25, - "column": 57 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 25, - "column": 60 - }, - "end": { - "line": 25, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 60 - }, - "end": { - "line": 25, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 61 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 62 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T15", - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 26, - "column": 28 - }, - "end": { - "line": 26, - "column": 29 - } - } - }, - "constraint": { - "type": "TSConditionalType", - "checkType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 26, - "column": 39 - }, - "end": { - "line": 26, - "column": 40 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 26, - "column": 39 - }, - "end": { - "line": 26, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 33 - }, - "end": { - "line": 26, - "column": 48 - } - } - }, - "extendsType": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 26, - "column": 55 - }, - "end": { - "line": 26, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 55 - }, - "end": { - "line": 26, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 49 - }, - "end": { - "line": 26, - "column": 56 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 59 - }, - "end": { - "line": 26, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 59 - }, - "end": { - "line": 26, - "column": 60 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 26, - "column": 63 - }, - "end": { - "line": 26, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 63 - }, - "end": { - "line": 26, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 33 - }, - "end": { - "line": 26, - "column": 64 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 26, - "column": 28 - }, - "end": { - "line": 26, - "column": 64 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 67 - }, - "end": { - "line": 26, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 67 - }, - "end": { - "line": 26, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 25 - }, - "end": { - "line": 26, - "column": 71 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 74 - }, - "end": { - "line": 26, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 74 - }, - "end": { - "line": 26, - "column": 75 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 26, - "column": 78 - }, - "end": { - "line": 26, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 78 - }, - "end": { - "line": 26, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 79 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 80 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T16", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 15 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 15 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "constraint": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 27, - "column": 39 - }, - "end": { - "line": 27, - "column": 40 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 55 - }, - "end": { - "line": 27, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 55 - }, - "end": { - "line": 27, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 49 - }, - "end": { - "line": 27, - "column": 56 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 39 - }, - "end": { - "line": 27, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 33 - }, - "end": { - "line": 27, - "column": 57 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 57 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 59 - }, - "end": { - "line": 27, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 59 - }, - "end": { - "line": 27, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 25 - }, - "end": { - "line": 27, - "column": 63 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 66 - }, - "end": { - "line": 27, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 66 - }, - "end": { - "line": 27, - "column": 67 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 27, - "column": 70 - }, - "end": { - "line": 27, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 70 - }, - "end": { - "line": 27, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 15 - }, - "end": { - "line": 27, - "column": 71 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 72 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T17", - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 28, - "column": 28 - }, - "end": { - "line": 28, - "column": 29 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 28, - "column": 39 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 39 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 33 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 28, - "column": 28 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "nameKeyType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 28, - "column": 50 - }, - "end": { - "line": 28, - "column": 51 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 28, - "column": 50 - }, - "end": { - "line": 28, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 44 - }, - "end": { - "line": 28, - "column": 59 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 28, - "column": 60 - }, - "end": { - "line": 28, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 60 - }, - "end": { - "line": 28, - "column": 61 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 64 - }, - "end": { - "line": 28, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 64 - }, - "end": { - "line": 28, - "column": 65 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 28, - "column": 68 - }, - "end": { - "line": 28, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 68 - }, - "end": { - "line": 28, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 44 - }, - "end": { - "line": 28, - "column": 69 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 72 - }, - "end": { - "line": 28, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 72 - }, - "end": { - "line": 28, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 25 - }, - "end": { - "line": 28, - "column": 76 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 79 - }, - "end": { - "line": 28, - "column": 80 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 79 - }, - "end": { - "line": 28, - "column": 80 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 28, - "column": 83 - }, - "end": { - "line": 28, - "column": 84 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 83 - }, - "end": { - "line": 28, - "column": 84 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 84 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 28, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 28, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 85 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T18", - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSMappedType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 29, - "column": 29 - } - } - }, - "constraint": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 29, - "column": 39 - }, - "end": { - "line": 29, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 39 - }, - "end": { - "line": 29, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 33 - }, - "end": { - "line": 29, - "column": 40 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 28 - }, - "end": { - "line": 29, - "column": 40 - } - } - }, - "nameKeyType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 29, - "column": 50 - }, - "end": { - "line": 29, - "column": 51 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "P", - "loc": { - "start": { - "line": 29, - "column": 60 - }, - "end": { - "line": 29, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 60 - }, - "end": { - "line": 29, - "column": 61 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 50 - }, - "end": { - "line": 29, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 44 - }, - "end": { - "line": 29, - "column": 62 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 29, - "column": 64 - }, - "end": { - "line": 29, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 64 - }, - "end": { - "line": 29, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 25 - }, - "end": { - "line": 29, - "column": 68 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 29, - "column": 71 - }, - "end": { - "line": 29, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 71 - }, - "end": { - "line": 29, - "column": 72 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 29, - "column": 75 - }, - "end": { - "line": 29, - "column": 76 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 75 - }, - "end": { - "line": 29, - "column": 76 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 76 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 29, - "column": 77 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 30, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends4.ts b/es2panda/test/parser/ts/test_infer-type-with-extends4.ts deleted file mode 100644 index 2d0a7408ec1d3431d076fbca4645cc4926f26b64..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends4.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -// Speculative lookahead for `infer T extends U ?` -type T10 = T extends (infer U extends number ? 1 : 0) ? 1 : 0; // ok, parsed as conditional -type X10_Y1 = T10; -type X10_T1_T1 = X10_Y1; - -type T11 = T extends ((infer U) extends number ? 1 : 0) ? 1 : 0; // ok, parsed as conditional -type T12 = T extends (infer U extends number) ? 1 : 0; // ok, parsed as `infer..extends` (no trailing `?`) -type T13 = T extends infer U extends number ? 1 : 0; // ok, parsed as `infer..extends` (conditional types not allowed in 'extends type') -type T14 = T extends keyof infer U extends number ? 1 : 0; // ok, parsed as `infer..extends` (precedence wouldn't have parsed the `?` as part of a type operator) -type T15 = T extends { [P in infer U extends keyof T ? 1 : 0]: 1; } ? 1 : 0; // ok, parsed as conditional -type T16 = T extends { [P in infer U extends keyof T]: 1; } ? 1 : 0; // ok, parsed as `infer..extends` (no trailing `?`) -type T17 = T extends { [P in keyof T as infer U extends P ? 1 : 0]: 1; } ? 1 : 0; // ok, parsed as conditional -type T18 = T extends { [P in keyof T as infer U extends P]: 1; } ? 1 : 0; // ok, parsed as `infer..extends` (no trailing `?`) diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends5-expected.txt b/es2panda/test/parser/ts/test_infer-type-with-extends5-expected.txt deleted file mode 100644 index 7b82d492dcda60daeb03e8b92443df7621d44734..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends5-expected.txt +++ /dev/null @@ -1,4433 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T19", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 57 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 66 - }, - "end": { - "line": 17, - "column": 72 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 56 - }, - "end": { - "line": 17, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 50 - }, - "end": { - "line": 17, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 49 - }, - "end": { - "line": 17, - "column": 73 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 77 - }, - "end": { - "line": 17, - "column": 78 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 77 - }, - "end": { - "line": 17, - "column": 78 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 17, - "column": 80 - }, - "end": { - "line": 17, - "column": 81 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 80 - }, - "end": { - "line": 17, - "column": 81 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 76 - }, - "end": { - "line": 17, - "column": 82 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 17, - "column": 85 - }, - "end": { - "line": 17, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 39 - }, - "end": { - "line": 17, - "column": 90 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "constraint": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 91 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X19_T1", - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T19", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X19_T2", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T19", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X19_T3", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T19", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 28 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T20", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 33 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 42 - }, - "end": { - "line": 22, - "column": 48 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 49 - } - } - }, - "trueType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 52 - }, - "end": { - "line": 22, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 52 - }, - "end": { - "line": 22, - "column": 53 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "V", - "loc": { - "start": { - "line": 22, - "column": 69 - }, - "end": { - "line": 22, - "column": 70 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 22, - "column": 79 - }, - "end": { - "line": 22, - "column": 80 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 79 - }, - "end": { - "line": 22, - "column": 80 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 69 - }, - "end": { - "line": 22, - "column": 81 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 63 - }, - "end": { - "line": 22, - "column": 81 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 62 - }, - "end": { - "line": 22, - "column": 81 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 85 - }, - "end": { - "line": 22, - "column": 86 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 85 - }, - "end": { - "line": 22, - "column": 86 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 22, - "column": 88 - }, - "end": { - "line": 22, - "column": 89 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 88 - }, - "end": { - "line": 22, - "column": 89 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "V", - "loc": { - "start": { - "line": 22, - "column": 91 - }, - "end": { - "line": 22, - "column": 92 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 91 - }, - "end": { - "line": 22, - "column": 92 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 84 - }, - "end": { - "line": 22, - "column": 93 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 22, - "column": 96 - }, - "end": { - "line": 22, - "column": 101 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 52 - }, - "end": { - "line": 22, - "column": 101 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 22, - "column": 104 - }, - "end": { - "line": 22, - "column": 109 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 109 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 110 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X20_T1", - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T20", - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 23, - "column": 23 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 23 - }, - "end": { - "line": 23, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T21", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 33 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 33 - }, - "end": { - "line": 25, - "column": 34 - } - } - }, - "extendsType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 50 - }, - "end": { - "line": 25, - "column": 51 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "N", - "loc": { - "start": { - "line": 25, - "column": 60 - }, - "end": { - "line": 25, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 60 - }, - "end": { - "line": 25, - "column": 61 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 50 - }, - "end": { - "line": 25, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 44 - }, - "end": { - "line": 25, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 43 - }, - "end": { - "line": 25, - "column": 62 - } - } - }, - "trueType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 66 - }, - "end": { - "line": 25, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 66 - }, - "end": { - "line": 25, - "column": 67 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 25, - "column": 69 - }, - "end": { - "line": 25, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 69 - }, - "end": { - "line": 25, - "column": 70 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 65 - }, - "end": { - "line": 25, - "column": 71 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 25, - "column": 74 - }, - "end": { - "line": 25, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 33 - }, - "end": { - "line": 25, - "column": 79 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "N", - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 14 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 23 - }, - "end": { - "line": 25, - "column": 29 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 80 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X21_T1", - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T21", - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X21_T2", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T21", - "loc": { - "start": { - "line": 27, - "column": 15 - }, - "end": { - "line": 27, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 19 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 28 - }, - "end": { - "line": 27, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 15 - }, - "end": { - "line": 27, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 31 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X21_T3", - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T21", - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 28, - "column": 23 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 23 - }, - "end": { - "line": 28, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 26 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 26 - }, - "end": { - "line": 28, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 29 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X21_T4", - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T21", - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 29, - "column": 23 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 23 - }, - "end": { - "line": 29, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 19 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 27 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 29, - "column": 30 - }, - "end": { - "line": 29, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 30 - }, - "end": { - "line": 29, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 15 - }, - "end": { - "line": 29, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 29, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X21_T5", - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 12 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T21", - "loc": { - "start": { - "line": 30, - "column": 15 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 20 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 30, - "column": 23 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 23 - }, - "end": { - "line": 30, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 30, - "column": 26 - }, - "end": { - "line": 30, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 26 - }, - "end": { - "line": 30, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 15 - }, - "end": { - "line": 30, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 1 - }, - "end": { - "line": 30, - "column": 29 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "IfEquals", - "loc": { - "start": { - "line": 33, - "column": 6 - }, - "end": { - "line": 33, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 31 - }, - "end": { - "line": 33, - "column": 32 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 31 - }, - "end": { - "line": 33, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 30 - }, - "end": { - "line": 33, - "column": 33 - } - } - }, - "returnType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 39 - }, - "end": { - "line": 33, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 39 - }, - "end": { - "line": 33, - "column": 40 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "X", - "loc": { - "start": { - "line": 33, - "column": 49 - }, - "end": { - "line": 33, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 49 - }, - "end": { - "line": 33, - "column": 50 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 33, - "column": 53 - }, - "end": { - "line": 33, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 53 - }, - "end": { - "line": 33, - "column": 54 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 33, - "column": 57 - }, - "end": { - "line": 33, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 57 - }, - "end": { - "line": 33, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 39 - }, - "end": { - "line": 33, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 30 - }, - "end": { - "line": 33, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 29 - }, - "end": { - "line": 33, - "column": 59 - } - } - }, - "extendsType": { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 69 - }, - "end": { - "line": 33, - "column": 70 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 69 - }, - "end": { - "line": 33, - "column": 71 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 68 - }, - "end": { - "line": 33, - "column": 71 - } - } - }, - "returnType": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 33, - "column": 77 - }, - "end": { - "line": 33, - "column": 78 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 77 - }, - "end": { - "line": 33, - "column": 78 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Y", - "loc": { - "start": { - "line": 33, - "column": 87 - }, - "end": { - "line": 33, - "column": 88 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 87 - }, - "end": { - "line": 33, - "column": 88 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 33, - "column": 91 - }, - "end": { - "line": 33, - "column": 92 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 91 - }, - "end": { - "line": 33, - "column": 92 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 33, - "column": 95 - }, - "end": { - "line": 33, - "column": 96 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 95 - }, - "end": { - "line": 33, - "column": 96 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 77 - }, - "end": { - "line": 33, - "column": 96 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 68 - }, - "end": { - "line": 33, - "column": 96 - } - } - }, - "trueType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 33, - "column": 99 - }, - "end": { - "line": 33, - "column": 100 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 99 - }, - "end": { - "line": 33, - "column": 100 - } - } - }, - "falseType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 33, - "column": 103 - }, - "end": { - "line": 33, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 103 - }, - "end": { - "line": 33, - "column": 104 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 29 - }, - "end": { - "line": 33, - "column": 104 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "X", - "loc": { - "start": { - "line": 33, - "column": 15 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 15 - }, - "end": { - "line": 33, - "column": 17 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "Y", - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 19 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 20 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 33, - "column": 24 - }, - "end": { - "line": 33, - "column": 25 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 33, - "column": 24 - }, - "end": { - "line": 33, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 1 - }, - "end": { - "line": 33, - "column": 105 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "val1", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 35, - "column": 22 - }, - "end": { - "line": 35, - "column": 23 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 35, - "column": 22 - }, - "end": { - "line": 35, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 35, - "column": 21 - }, - "end": { - "line": 35, - "column": 24 - } - } - }, - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 35, - "column": 31 - }, - "end": { - "line": 35, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 31 - }, - "end": { - "line": 35, - "column": 32 - } - } - }, - "extendsType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 35, - "column": 47 - }, - "end": { - "line": 35, - "column": 48 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 35, - "column": 57 - }, - "end": { - "line": 35, - "column": 63 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 35, - "column": 47 - }, - "end": { - "line": 35, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 41 - }, - "end": { - "line": 35, - "column": 65 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 35, - "column": 66 - }, - "end": { - "line": 35, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 66 - }, - "end": { - "line": 35, - "column": 67 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 35, - "column": 70 - }, - "end": { - "line": 35, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 70 - }, - "end": { - "line": 35, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 31 - }, - "end": { - "line": 35, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 30 - }, - "end": { - "line": 35, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 21 - }, - "end": { - "line": 35, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 15 - }, - "end": { - "line": 35, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 35, - "column": 15 - }, - "end": { - "line": 35, - "column": 19 - } - } - } - ], - "kind": "const", - "declare": true, - "loc": { - "start": { - "line": 35, - "column": 9 - }, - "end": { - "line": 35, - "column": 73 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func1", - "loc": { - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 36, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "val1", - "loc": { - "start": { - "line": 37, - "column": 12 - }, - "end": { - "line": 37, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 18 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "ExpectNumber", - "loc": { - "start": { - "line": 40, - "column": 6 - }, - "end": { - "line": 40, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 40, - "column": 39 - }, - "end": { - "line": 40, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 39 - }, - "end": { - "line": 40, - "column": 40 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 40, - "column": 19 - }, - "end": { - "line": 40, - "column": 20 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 40, - "column": 29 - }, - "end": { - "line": 40, - "column": 35 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 40, - "column": 19 - }, - "end": { - "line": 40, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 18 - }, - "end": { - "line": 40, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 41 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "val2", - "typeAnnotation": { - "type": "TSFunctionType", - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 41, - "column": 22 - }, - "end": { - "line": 41, - "column": 23 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 41, - "column": 22 - }, - "end": { - "line": 41, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 21 - }, - "end": { - "line": 41, - "column": 24 - } - } - }, - "returnType": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 41, - "column": 31 - }, - "end": { - "line": 41, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 31 - }, - "end": { - "line": 41, - "column": 32 - } - } - }, - "extendsType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ExpectNumber", - "loc": { - "start": { - "line": 41, - "column": 41 - }, - "end": { - "line": 41, - "column": 53 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 41, - "column": 60 - }, - "end": { - "line": 41, - "column": 61 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 41, - "column": 60 - }, - "end": { - "line": 41, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 54 - }, - "end": { - "line": 41, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 53 - }, - "end": { - "line": 41, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 41 - }, - "end": { - "line": 41, - "column": 53 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 41, - "column": 65 - }, - "end": { - "line": 41, - "column": 66 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 65 - }, - "end": { - "line": 41, - "column": 66 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 41, - "column": 69 - }, - "end": { - "line": 41, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 69 - }, - "end": { - "line": 41, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 31 - }, - "end": { - "line": 41, - "column": 70 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 30 - }, - "end": { - "line": 41, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 21 - }, - "end": { - "line": 41, - "column": 71 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 15 - }, - "end": { - "line": 41, - "column": 19 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 41, - "column": 15 - }, - "end": { - "line": 41, - "column": 19 - } - } - } - ], - "kind": "const", - "declare": true, - "loc": { - "start": { - "line": 41, - "column": 9 - }, - "end": { - "line": 41, - "column": 72 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "fun2", - "loc": { - "start": { - "line": 42, - "column": 10 - }, - "end": { - "line": 42, - "column": 14 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "val2", - "loc": { - "start": { - "line": 43, - "column": 12 - }, - "end": { - "line": 43, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 42, - "column": 17 - }, - "end": { - "line": 44, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 44, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 1 - }, - "end": { - "line": 44, - "column": 2 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "X22", - "loc": { - "start": { - "line": 46, - "column": 6 - }, - "end": { - "line": 46, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 46, - "column": 15 - }, - "end": { - "line": 46, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 15 - }, - "end": { - "line": 46, - "column": 16 - } - } - }, - "extendsType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 46, - "column": 32 - }, - "end": { - "line": 46, - "column": 33 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 46, - "column": 42 - }, - "end": { - "line": 46, - "column": 48 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 46, - "column": 32 - }, - "end": { - "line": 46, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 26 - }, - "end": { - "line": 46, - "column": 49 - } - } - }, - { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 46, - "column": 56 - }, - "end": { - "line": 46, - "column": 57 - } - } - }, - "constraint": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 46, - "column": 66 - }, - "end": { - "line": 46, - "column": 72 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 46, - "column": 56 - }, - "end": { - "line": 46, - "column": 73 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 50 - }, - "end": { - "line": 46, - "column": 73 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 25 - }, - "end": { - "line": 46, - "column": 73 - } - } - }, - "trueType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 46, - "column": 76 - }, - "end": { - "line": 46, - "column": 82 - } - } - }, - "falseType": { - "type": "TSNeverKeyword", - "loc": { - "start": { - "line": 46, - "column": 85 - }, - "end": { - "line": 46, - "column": 90 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 15 - }, - "end": { - "line": 46, - "column": 90 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 46, - "column": 10 - }, - "end": { - "line": 46, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 46, - "column": 10 - }, - "end": { - "line": 46, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 9 - }, - "end": { - "line": 46, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 1 - }, - "end": { - "line": 46, - "column": 91 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 48, - "column": 6 - }, - "end": { - "line": 48, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 48, - "column": 9 - }, - "end": { - "line": 48, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 9 - }, - "end": { - "line": 48, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 1 - }, - "end": { - "line": 49, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 49, - "column": 6 - }, - "end": { - "line": 49, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSConditionalType", - "checkType": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 14 - } - } - }, - "extendsType": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSConditionalType", - "checkType": { - "type": "TSInferType", - "typeParameter": { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 49, - "column": 30 - }, - "end": { - "line": 49, - "column": 31 - } - } - }, - "constraint": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "U", - "loc": { - "start": { - "line": 49, - "column": 40 - }, - "end": { - "line": 49, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 40 - }, - "end": { - "line": 49, - "column": 41 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 49, - "column": 30 - }, - "end": { - "line": 49, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 24 - }, - "end": { - "line": 49, - "column": 49 - } - } - }, - "extendsType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 49, - "column": 50 - }, - "end": { - "line": 49, - "column": 56 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 49, - "column": 59 - }, - "end": { - "line": 49, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 59 - }, - "end": { - "line": 49, - "column": 60 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 49, - "column": 61 - }, - "end": { - "line": 49, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 61 - }, - "end": { - "line": 49, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 24 - }, - "end": { - "line": 49, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 49, - "column": 23 - }, - "end": { - "line": 49, - "column": 64 - } - } - }, - "trueType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 49, - "column": 66 - }, - "end": { - "line": 49, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 66 - }, - "end": { - "line": 49, - "column": 67 - } - } - }, - "falseType": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 49, - "column": 68 - }, - "end": { - "line": 49, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 68 - }, - "end": { - "line": 49, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 13 - }, - "end": { - "line": 49, - "column": 69 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 49, - "column": 8 - }, - "end": { - "line": 49, - "column": 9 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 49, - "column": 8 - }, - "end": { - "line": 49, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 49, - "column": 7 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 1 - }, - "end": { - "line": 49, - "column": 69 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 49, - "column": 69 - } - } -} diff --git a/es2panda/test/parser/ts/test_infer-type-with-extends5.ts b/es2panda/test/parser/ts/test_infer-type-with-extends5.ts deleted file mode 100644 index 7acec8ae966c574ee25f4dd5260d86e3363dc266..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_infer-type-with-extends5.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type T19 = T extends (infer U extends number) ? [T, U] : never; -type X19_T1 = T19<"a">; // never -type X19_T2 = T19<1>; // [1, 1] -type X19_T3 = T19<1 | "a">; // [1, 1] - -type T20 = T extends (infer U extends number) ? T extends (infer V extends U) ? [T, U, V] : never : never; -type X20_T1 = T20<1 | "a">; // [1, 1, 1] - -type T21 = T extends (infer U extends N) ? [T, U] : never; -type X21_T1 = T21<1, 1>; // [1, 1] -type X21_T2 = T21<1 | "a", 1>; // [1, 1] -type X21_T3 = T21<1 | 2, 1>; // [1, 1] -type X21_T4 = T21<1 | 2, 2 | 3>; // [2, 2] -type X21_T5 = T21<1 | 2, 3>; // never - -// from mongoose -type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B; - -declare const val1: () => (T extends infer U extends number ? 1 : 0); -function func1() { - return val1; -} - -type ExpectNumber = T; -declare const val2: () => (T extends ExpectNumber ? 1 : 0); -function fun2() { - return val2; -} - -type X22 = T extends [infer U extends number, infer U extends number] ? string : never; - -type U =1 -type c = T extends [infer s extends U extends number ? 1:2 ]? 1:2 \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions1-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions1-expected.txt deleted file mode 100644 index 824ea4f23ad912cb2a30fde919d67bcf7c5bd497..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions1-expected.txt +++ /dev/null @@ -1,956 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "makeBox", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": true, - "computed": false, - "key": { - "type": "Identifier", - "name": "value", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "value": { - "type": "Identifier", - "name": "value", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 2 - }, - "end": { - "line": 19, - "column": 3 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "makeStringBox", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "init": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "makeBox", - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 37 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 30 - }, - "end": { - "line": 21, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 38 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 39 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "stringBox", - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "makeStringBox", - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 32 - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "abc", - "loc": { - "start": { - "line": 22, - "column": 33 - }, - "end": { - "line": 22, - "column": 38 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 39 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 40 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "StringBoxMaker", - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "makeBox", - "loc": { - "start": { - "line": 24, - "column": 30 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 38 - }, - "end": { - "line": 24, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 37 - }, - "end": { - "line": 24, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 23 - }, - "end": { - "line": 24, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 23 - }, - "end": { - "line": 24, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 46 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "BoxFunc", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "makeBox", - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 33 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 34 - }, - "end": { - "line": 25, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 34 - }, - "end": { - "line": 25, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 33 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 15 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 37 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Box", - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 9 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "ReturnType", - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeQuery", - "exprName": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "makeBox", - "loc": { - "start": { - "line": 26, - "column": 33 - }, - "end": { - "line": 26, - "column": 40 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 26, - "column": 41 - }, - "end": { - "line": 26, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 41 - }, - "end": { - "line": 26, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 40 - }, - "end": { - "line": 26, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 25 - }, - "end": { - "line": 26, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 45 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "StringBox", - "loc": { - "start": { - "line": 27, - "column": 6 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Box", - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 21 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 22 - }, - "end": { - "line": 27, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 28, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_instantiation_expressions1.ts b/es2panda/test/parser/ts/test_instantiation_expressions1.ts deleted file mode 100644 index d8c0f06373b8f5708cf327d97e496d897654aa91..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions1.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function makeBox(value: T) { - return { value }; -}; - -const makeStringBox = makeBox; // (value: string) => { value: string } -const stringBox = makeStringBox('abc'); // { value: string } - -type StringBoxMaker = typeof makeBox; // (value: string) => { value: string } -type BoxFunc = typeof makeBox; // (value: T) => { value: T } -type Box = ReturnType>; // { value: T } -type StringBox = Box; // { value: string } \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions2-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions2-expected.txt deleted file mode 100644 index 911265f09eeb635f5fd111f2649664af3aa0d17b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions2-expected.txt +++ /dev/null @@ -1,333 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ErrorMap", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "init": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "Map", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Error", - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 36 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "errorMap", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "init": { - "type": "NewExpression", - "callee": { - "type": "Identifier", - "name": "ErrorMap", - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 32 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "ErrorMapConstructor", - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "Map", - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 39 - }, - "end": { - "line": 20, - "column": 45 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Error", - "loc": { - "start": { - "line": 20, - "column": 47 - }, - "end": { - "line": 20, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 47 - }, - "end": { - "line": 20, - "column": 52 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 54 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_instantiation_expressions2.ts b/es2panda/test/parser/ts/test_instantiation_expressions2.ts deleted file mode 100644 index 1fcafc7e2401e6eba21e3b0a22df1972ea2cbfdd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const ErrorMap = Map; // new () => Map -const errorMap = new ErrorMap(); // Map - -type ErrorMapConstructor = typeof Map; // new () => Map \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions3-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions3-expected.txt deleted file mode 100644 index 487f379027a003e9e29816a1d823ccd5b93e6288..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions3-expected.txt +++ /dev/null @@ -1,808 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "value", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 20 - } - } - } - ], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "print", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "value", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "operator": "&&", - "left": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 22, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 2 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "right": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "operator": "||", - "left": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 25, - "column": 3 - }, - "end": { - "line": 25, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "right": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 15 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 25, - "column": 16 - }, - "end": { - "line": 25, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "LogicalExpression", - "operator": "??", - "left": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 28, - "column": 3 - }, - "end": { - "line": 28, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 2 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 10 - } - } - }, - "right": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 15 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 28, - "column": 16 - }, - "end": { - "line": 28, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 15 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 6 - } - } - }, - "init": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 10 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 31, - "column": 11 - }, - "end": { - "line": 31, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 10 - }, - "end": { - "line": 31, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 18 - } - } - }, - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e", - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 21 - } - } - }, - "init": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 25 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 31, - "column": 26 - }, - "end": { - "line": 31, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 25 - }, - "end": { - "line": 31, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 33 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 33 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 31, - "column": 33 - } - } -} diff --git a/es2panda/test/parser/ts/test_instantiation_expressions3.ts b/es2panda/test/parser/ts/test_instantiation_expressions3.ts deleted file mode 100644 index 46f5cd2023de1677d5113e0084484518b27c63a3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions3.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function A(value: T) { - print(value) -} - -// "&&" after "<***>" -A && A - -// "||" after "<***>" -A || A - -// "??" after "<***>" -A ?? A - -// "," after "<***>" -var d = A, e = A \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions4-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions4-expected.txt deleted file mode 100644 index bf67950a4517921df9f37306f2c11c32946e2e55..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Invalid left-hand side in assignment expression [test_instantiation_expressions4.ts:22:11] diff --git a/es2panda/test/parser/ts/test_instantiation_expressions4.ts b/es2panda/test/parser/ts/test_instantiation_expressions4.ts deleted file mode 100644 index c66ff906c1c82dfbc05e1fa909e0696572b2c176..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions4.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function A(value: T) { - print(value) -} - -// "&&=" after "<***>" -A &&= A \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions5-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions5-expected.txt deleted file mode 100644 index e1ea674986b0e7e462dbadf6f29d77a9ea8759bc..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Invalid left-hand side in assignment expression [test_instantiation_expressions5.ts:22:11] diff --git a/es2panda/test/parser/ts/test_instantiation_expressions5.ts b/es2panda/test/parser/ts/test_instantiation_expressions5.ts deleted file mode 100644 index 652c47e02e50eff4255d39f537456be21168fe8a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions5.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function A(value: T) { - print(value) -} - -// "||=" after "<***>" -A ||= A \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions6-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions6-expected.txt deleted file mode 100644 index c008d35b9d3f2b3de51f8f461c1f623e9b84af46..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Invalid left-hand side in assignment expression [test_instantiation_expressions6.ts:22:11] diff --git a/es2panda/test/parser/ts/test_instantiation_expressions6.ts b/es2panda/test/parser/ts/test_instantiation_expressions6.ts deleted file mode 100644 index c04ddf8965b4a02803a30082e956c4df32b72026..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions6.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function A(value: T) { - print(value) -} - -// "=" after "<***>" -A = A \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_instantiation_expressions7-expected.txt b/es2panda/test/parser/ts/test_instantiation_expressions7-expected.txt deleted file mode 100644 index 3087a4ccc70662658ccd48b04c9027576352150e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions7-expected.txt +++ /dev/null @@ -1,310 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "in": false, - "out": false, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ChainExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 5 - } - } - }, - "arguments": [], - "optional": true, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "ChainExpression", - "expression": { - "type": "CallExpression", - "callee": { - "type": "TypeArgumentsExpression", - "leftHandExpression": { - "type": "Identifier", - "name": "func", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 5 - } - } - }, - "typeArguments": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Number", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "arguments": [], - "optional": true, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_instantiation_expressions7.ts b/es2panda/test/parser/ts/test_instantiation_expressions7.ts deleted file mode 100644 index e75824607728c924d3dfc35a680d3c9e9df9b9ca..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_instantiation_expressions7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function func() {} -func?.(); -func?.(); diff --git a/es2panda/test/parser/ts/test_label_break-expected.txt b/es2panda/test/parser/ts/test_label_break-expected.txt deleted file mode 100644 index 02db09a63585c8982fae0d1ebc16d1ddbc90a040..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_label_break-expected.txt +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "LabelledStatement", - "label": { - "type": "Identifier", - "name": "target", - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 7 - } - } - }, - "body": { - "type": "BreakStatement", - "label": { - "type": "Identifier", - "name": "target", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 17, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_label_break.ts b/es2panda/test/parser/ts/test_label_break.ts deleted file mode 100644 index 3dc81e0d2aa0907d980f2896ce81f9b68408727c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_label_break.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -target: - break target; diff --git a/es2panda/test/parser/ts/test_module-expected.txt b/es2panda/test/parser/ts/test_module-expected.txt deleted file mode 100644 index 17d1cf9dffa9a82f839f62346eca0ab0bb2d5afc..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module-expected.txt +++ /dev/null @@ -1,1848 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 11 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 25 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 21, - "column": 38 - }, - "end": { - "line": 21, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 46 - } - } - }, - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "params": [], - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 23, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "id": { - "type": "Identifier", - "name": "B", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 11 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 29, - "column": 14 - }, - "end": { - "line": 29, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 30, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 32, - "column": 7 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 32, - "column": 8 - }, - "end": { - "line": 32, - "column": 9 - } - } - }, - "body": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 32, - "column": 11 - } - } - }, - "body": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 32, - "column": 12 - }, - "end": { - "line": 32, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 11 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 35, - "column": 14 - }, - "end": { - "line": 35, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 35, - "column": 18 - }, - "end": { - "line": 35, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 32, - "column": 14 - }, - "end": { - "line": 36, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 32, - "column": 12 - }, - "end": { - "line": 39, - "column": 7 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 39, - "column": 7 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 39, - "column": 7 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 39, - "column": 8 - }, - "end": { - "line": 39, - "column": 9 - } - } - }, - "body": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 39, - "column": 11 - } - } - }, - "body": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 39, - "column": 12 - }, - "end": { - "line": 39, - "column": 13 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 40, - "column": 9 - }, - "end": { - "line": 40, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 40, - "column": 9 - }, - "end": { - "line": 40, - "column": 10 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 11 - } - } - }, - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "t", - "loc": { - "start": { - "line": 42, - "column": 14 - }, - "end": { - "line": 42, - "column": 15 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 42, - "column": 18 - }, - "end": { - "line": 42, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 5 - }, - "end": { - "line": 42, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 14 - }, - "end": { - "line": 43, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 39, - "column": 12 - }, - "end": { - "line": 45, - "column": 8 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 45, - "column": 8 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 39, - "column": 1 - }, - "end": { - "line": 45, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "k", - "loc": { - "start": { - "line": 45, - "column": 19 - }, - "end": { - "line": 45, - "column": 20 - } - } - }, - "body": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "z", - "loc": { - "start": { - "line": 45, - "column": 21 - }, - "end": { - "line": 45, - "column": 22 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 45, - "column": 23 - }, - "end": { - "line": 47, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 45, - "column": 21 - }, - "end": { - "line": 49, - "column": 8 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 45, - "column": 9 - }, - "end": { - "line": 49, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 49, - "column": 9 - }, - "end": { - "line": 49, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 49, - "column": 16 - }, - "end": { - "line": 51, - "column": 2 - } - } - }, - "declare": true, - "global": true, - "loc": { - "start": { - "line": 49, - "column": 9 - }, - "end": { - "line": 53, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 53, - "column": 16 - }, - "end": { - "line": 53, - "column": 21 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 53, - "column": 9 - }, - "end": { - "line": 55, - "column": 7 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 55, - "column": 12 - }, - "end": { - "line": 55, - "column": 13 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 55, - "column": 12 - }, - "end": { - "line": 55, - "column": 13 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 55, - "column": 8 - }, - "end": { - "line": 55, - "column": 14 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 55, - "column": 1 - }, - "end": { - "line": 55, - "column": 14 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "module1", - "loc": { - "start": { - "line": 57, - "column": 8 - }, - "end": { - "line": 57, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 58, - "column": 24 - }, - "end": { - "line": 58, - "column": 25 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 58, - "column": 24 - }, - "end": { - "line": 58, - "column": 25 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 58, - "column": 20 - }, - "end": { - "line": 58, - "column": 26 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 58, - "column": 5 - }, - "end": { - "line": 58, - "column": 26 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 59, - "column": 17 - }, - "end": { - "line": 59, - "column": 18 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 59, - "column": 17 - }, - "end": { - "line": 59, - "column": 18 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 59, - "column": 13 - }, - "end": { - "line": 59, - "column": 19 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 60, - "column": 9 - }, - "end": { - "line": 60, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 60, - "column": 9 - }, - "end": { - "line": 60, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 60, - "column": 5 - }, - "end": { - "line": 60, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 57, - "column": 16 - }, - "end": { - "line": 61, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 57, - "column": 1 - }, - "end": { - "line": 63, - "column": 7 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "module2", - "loc": { - "start": { - "line": 63, - "column": 15 - }, - "end": { - "line": 63, - "column": 22 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 64, - "column": 24 - }, - "end": { - "line": 64, - "column": 25 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 64, - "column": 24 - }, - "end": { - "line": 64, - "column": 25 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 64, - "column": 20 - }, - "end": { - "line": 64, - "column": 26 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 64, - "column": 5 - }, - "end": { - "line": 64, - "column": 26 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 65, - "column": 17 - }, - "end": { - "line": 65, - "column": 18 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 65, - "column": 17 - }, - "end": { - "line": 65, - "column": 18 - } - } - } - ], - "kind": "var", - "declare": true, - "loc": { - "start": { - "line": 65, - "column": 13 - }, - "end": { - "line": 65, - "column": 19 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 66, - "column": 9 - }, - "end": { - "line": 66, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 66, - "column": 9 - }, - "end": { - "line": 66, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 66, - "column": 5 - }, - "end": { - "line": 66, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 63, - "column": 23 - }, - "end": { - "line": 67, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 63, - "column": 8 - }, - "end": { - "line": 69, - "column": 8 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 63, - "column": 1 - }, - "end": { - "line": 69, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "module3", - "loc": { - "start": { - "line": 69, - "column": 16 - }, - "end": { - "line": 69, - "column": 23 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 70, - "column": 9 - }, - "end": { - "line": 70, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 70, - "column": 9 - }, - "end": { - "line": 70, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 70, - "column": 5 - }, - "end": { - "line": 70, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 24 - }, - "end": { - "line": 71, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 69, - "column": 9 - }, - "end": { - "line": 73, - "column": 7 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "module4", - "loc": { - "start": { - "line": 73, - "column": 23 - }, - "end": { - "line": 73, - "column": 30 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 74, - "column": 9 - }, - "end": { - "line": 74, - "column": 10 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 74, - "column": 9 - }, - "end": { - "line": 74, - "column": 10 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 74, - "column": 5 - }, - "end": { - "line": 74, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 73, - "column": 31 - }, - "end": { - "line": 75, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 73, - "column": 16 - }, - "end": { - "line": 77, - "column": 8 - } - } - }, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 73, - "column": 1 - }, - "end": { - "line": 77, - "column": 8 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 77, - "column": 16 - }, - "end": { - "line": 77, - "column": 21 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "TSImportEqualsDeclaration", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 78, - "column": 19 - }, - "end": { - "line": 78, - "column": 20 - } - } - }, - "moduleReference": { - "type": "TSExternalModuleReference", - "expression": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 78, - "column": 31 - }, - "end": { - "line": 78, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 78, - "column": 23 - }, - "end": { - "line": 78, - "column": 37 - } - } - }, - "isExport": true, - "loc": { - "start": { - "line": 78, - "column": 5 - }, - "end": { - "line": 78, - "column": 38 - } - } - }, - { - "type": "TSImportEqualsDeclaration", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 79, - "column": 12 - }, - "end": { - "line": 79, - "column": 13 - } - } - }, - "moduleReference": { - "type": "TSExternalModuleReference", - "expression": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 79, - "column": 24 - }, - "end": { - "line": 79, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 79, - "column": 16 - }, - "end": { - "line": 79, - "column": 30 - } - } - }, - "isExport": false, - "loc": { - "start": { - "line": 79, - "column": 5 - }, - "end": { - "line": 79, - "column": 31 - } - } - }, - { - "type": "TSImportEqualsDeclaration", - "id": { - "type": "Identifier", - "name": "c", - "loc": { - "start": { - "line": 80, - "column": 12 - }, - "end": { - "line": 80, - "column": 13 - } - } - }, - "moduleReference": { - "type": "Identifier", - "name": "require", - "loc": { - "start": { - "line": 80, - "column": 16 - }, - "end": { - "line": 80, - "column": 23 - } - } - }, - "isExport": false, - "loc": { - "start": { - "line": 80, - "column": 5 - }, - "end": { - "line": 80, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 77, - "column": 22 - }, - "end": { - "line": 81, - "column": 2 - } - } - }, - "declare": true, - "global": false, - "loc": { - "start": { - "line": 77, - "column": 9 - }, - "end": { - "line": 82, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 82, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_module.ts b/es2panda/test/parser/ts/test_module.ts deleted file mode 100644 index 5ceae19d5b0a10f3daa0a57e86b11f2a3a77e6dc..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -namespace a { - let a; - - interface B { - a: (a: number, b: string) => boolean, - b(): number - } -} - -namespace a { - let a; - - function b() { } -} - -module a.b.c { - let a; - - function t() { } -} - - -module a.b.c { - let a; - - function t() { } -} - -declare namespace k.z { - -} - -declare global { - -} - -declare module "foo"; - -export var c; - -module module1 { - export declare var a; - declare var b; - var c; -} - -export module module2 { - export declare var a; - declare var b; - var c; -} - -declare module module3 { - var b; -} - -export declare module module4 { - var b; -} - -declare module "foo" { - export import a = require("bar"); - import b = require("bar"); - import c = require; -} diff --git a/es2panda/test/parser/ts/test_module1-expected.txt b/es2panda/test/parser/ts/test_module1-expected.txt deleted file mode 100644 index 3efeb6fd57212c9ae21a7d239dfa7eb2675d6378..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'declare' modifier cannot be used in an already ambient context. [test_module1.ts:18:5] diff --git a/es2panda/test/parser/ts/test_module1.ts b/es2panda/test/parser/ts/test_module1.ts deleted file mode 100644 index 1f389def9318c9548096af562ec3a4db47c1d81e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module1.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare module Foo { - declare var a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_module10-expected.txt b/es2panda/test/parser/ts/test_module10-expected.txt deleted file mode 100644 index 0269a608210e3add9a30832cbedd7e855f99da36..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module10-expected.txt +++ /dev/null @@ -1,157 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 19 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 15 - } - } - }, - "declare": true, - "global": true, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 3 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_module10.ts b/es2panda/test/parser/ts/test_module10.ts deleted file mode 100644 index ef15a5d7b282807a521b13942f2ca6313807f8a5..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module10.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export{} -var a : number = 1; -declare global -a; diff --git a/es2panda/test/parser/ts/test_module2-expected.txt b/es2panda/test/parser/ts/test_module2-expected.txt deleted file mode 100644 index 698a8237f4c9aa32049c483304808c686bbb8de8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'declare' modifier cannot be used in an already ambient context. [test_module2.ts:18:5] diff --git a/es2panda/test/parser/ts/test_module2.ts b/es2panda/test/parser/ts/test_module2.ts deleted file mode 100644 index 56da09d96d23533ec5d5ca9e9294e11e79a3beb6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export declare module Foo { - declare var a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_module3-expected.txt b/es2panda/test/parser/ts/test_module3-expected.txt deleted file mode 100644 index 83fe37f2fe11d5cb020b1801a706edd201631293..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'declare' modifier cannot be used in an already ambient context. [test_module3.ts:18:12] diff --git a/es2panda/test/parser/ts/test_module3.ts b/es2panda/test/parser/ts/test_module3.ts deleted file mode 100644 index 25a9f8732eaa487330f8896075ed20d658c4128d..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module3.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare module Foo { - export declare var a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_module4-expected.txt b/es2panda/test/parser/ts/test_module4-expected.txt deleted file mode 100644 index dec03597cb32a5af76412afa31f302fc2d3c10cd..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module4-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'declare' modifier cannot be used in an already ambient context. [test_module4.ts:18:12] diff --git a/es2panda/test/parser/ts/test_module4.ts b/es2panda/test/parser/ts/test_module4.ts deleted file mode 100644 index baeda6aea606fe9805e0fdab55f63001f4d767f4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module4.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export declare module Foo { - export declare var a; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_module5-expected.txt b/es2panda/test/parser/ts/test_module5-expected.txt deleted file mode 100644 index b8b6de8d6feb041f15c9799c8755546f068b9980..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: String literal expected. [test_module5.ts:18:24] diff --git a/es2panda/test/parser/ts/test_module5.ts b/es2panda/test/parser/ts/test_module5.ts deleted file mode 100644 index 14f781c4f668475ea8fa745ec205d35e4181f649..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module5.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare module "foo" { - import a = require(bar); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_module6-expected.txt b/es2panda/test/parser/ts/test_module6-expected.txt deleted file mode 100644 index 27f995be8e141660287fe7cb3ec0c06ffeb2c6b7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: ')' expected. [test_module6.ts:18:29] diff --git a/es2panda/test/parser/ts/test_module6.ts b/es2panda/test/parser/ts/test_module6.ts deleted file mode 100644 index 01a295bd883a540e7217a2748bf23dbd929798c0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module6.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare module "foo" { - import a = require("bar"[0]); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_module7-expected.txt b/es2panda/test/parser/ts/test_module7-expected.txt deleted file mode 100644 index 4c3574c4decc8652f708273c9d9631745c23bd97..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module7-expected.txt +++ /dev/null @@ -1,435 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "right": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "module", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 14 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 18 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "right": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "namespace", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 11 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 15 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 7 - } - } - }, - "right": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_module7.ts b/es2panda/test/parser/ts/test_module7.ts deleted file mode 100644 index 754cbd86b6ffb4ceb13d2251e48a7bf1d0536656..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module7.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var module = 1; -module = module + 1; - -var namespace = 1; -namespace = namespace + 1; - -var global = 1; -global = global + 1; diff --git a/es2panda/test/parser/ts/test_module8-expected.txt b/es2panda/test/parser/ts/test_module8-expected.txt deleted file mode 100644 index 6e3da20885fee95396271890f03caa2ffcb5f53a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module8-expected.txt +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [], - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, - "declare": true, - "global": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 19, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_module8.ts b/es2panda/test/parser/ts/test_module8.ts deleted file mode 100644 index 7d3b3016556bc01403ded4b075a7a3c1f456de92..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module8.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -export{} -declare global {} diff --git a/es2panda/test/parser/ts/test_module9-expected.txt b/es2panda/test/parser/ts/test_module9-expected.txt deleted file mode 100644 index 757b6ed1c27b3221e32b452aba331ddf056c1e7b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module9-expected.txt +++ /dev/null @@ -1,60 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "global", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "declare": true, - "global": true, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - { - "type": "ExportNamedDeclaration", - "declaration": null, - "source": null, - "specifiers": [], - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_module9.ts b/es2panda/test/parser/ts/test_module9.ts deleted file mode 100644 index e6cac24b0a0da31d2143a1fefed61dc0d80dfaaf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module9.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -declare global -export {} diff --git a/es2panda/test/parser/ts/test_module_binder-expected.txt b/es2panda/test/parser/ts/test_module_binder-expected.txt deleted file mode 100644 index f60c5b4f9b7ac082d8ecd37ad3f7bc09d7474179..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module_binder-expected.txt +++ /dev/null @@ -1,228 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSModuleDeclaration", - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "body": { - "type": "TSModuleBlock", - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 16 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "declare": false, - "global": false, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_module_binder.ts b/es2panda/test/parser/ts/test_module_binder.ts deleted file mode 100644 index 8a6f5c72481a0f5a567f5d411eeebf3f6e07aa32..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_module_binder.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -module A { - class A { s: string } -} diff --git a/es2panda/test/parser/ts/test_override-expected.txt b/es2panda/test/parser/ts/test_override-expected.txt deleted file mode 100644 index 942981d30161aff30b01fc64a3999b05ac83fc75..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. [test_override.ts:18:14] diff --git a/es2panda/test/parser/ts/test_override.ts b/es2panda/test/parser/ts/test_override.ts deleted file mode 100644 index 8e71ecd8ca7e4104a747365ac5fe128824a61888..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class O1 { - override p1: number = 1 - foo (v: string) {} -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_override1-expected.txt b/es2panda/test/parser/ts/test_override1-expected.txt deleted file mode 100644 index b45e4dcfaddb5ace43cfa7801fee8065e7a00824..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override1-expected.txt +++ /dev/null @@ -1,797 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "O2", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 9 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "v", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fooo", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 9 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "v", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 12 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 24 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "O3", - "loc": { - "start": { - "line": 22, - "column": 7 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "O2", - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "override": true, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "v", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 20 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 30 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fooo", - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 9 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "v", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 12 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 24 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 26, - "column": 1 - } - } -} diff --git a/es2panda/test/parser/ts/test_override1.ts b/es2panda/test/parser/ts/test_override1.ts deleted file mode 100644 index a7127461fe5c8918382fed1bbdf13fa726951f08..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class O2 { - foo (v: string) {} - fooo (v: string) {} -} - -class O3 extends O2 { - override foo (v: string) {} - fooo (v: string) {} -} diff --git a/es2panda/test/parser/ts/test_override2-expected.txt b/es2panda/test/parser/ts/test_override2-expected.txt deleted file mode 100644 index 7329da9504923b7f654361ed1a08432dd1003995..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override2-expected.txt +++ /dev/null @@ -1,685 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "MyOverride", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, - "kind": "method", - "abstract": true, - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "kind": "method", - "abstract": true, - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "SubOverride", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "MyOverride", - "loc": { - "start": { - "line": 22, - "column": 36 - }, - "end": { - "line": 22, - "column": 46 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "RestElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "arguments": [ - { - "type": "SpreadElement", - "argument": { - "type": "Identifier", - "name": "args", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 23, - "column": 23 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - "kind": "method", - "abstract": true, - "static": false, - "optional": false, - "override": true, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 23, - "column": 30 - }, - "end": { - "line": 23, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 26 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 26 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 8 - } - } - }, - "kind": "method", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 14 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5 - }, - "end": { - "line": 24, - "column": 14 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 22, - "column": 47 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 25, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_override2.ts b/es2panda/test/parser/ts/test_override2.ts deleted file mode 100644 index 8ee1bedb3e6babf106a51ef9f5e6a79e985be82a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override2.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract class MyOverride { - abstract foo(): unknown; - abstract bar(): void; -} - -abstract class SubOverride extends MyOverride { - abstract override foo(): number; - bar() { } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_override3-expected.txt b/es2panda/test/parser/ts/test_override3-expected.txt deleted file mode 100644 index f702d7cc34aacbebb44d91c29a2f61ef35cd7a50..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override3-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test_override3.ts:23:14] diff --git a/es2panda/test/parser/ts/test_override3.ts b/es2panda/test/parser/ts/test_override3.ts deleted file mode 100644 index bf2e32b86d127d7fa9709af5bbf546386dda9ae9..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override3.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -abstract class MyOverride1 { - abstract foo(): unknown; - abstract bar(): void; -} - -abstract class SubOverride1 extends MyOverride1 { - override abstract foo(): number; - bar() { } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_override4-expected.txt b/es2panda/test/parser/ts/test_override4-expected.txt deleted file mode 100644 index d2f98bd241cbca4d5a9271c2d8b7a54f9c761169..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override4-expected.txt +++ /dev/null @@ -1,408 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "BaseOverride", - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "foo", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 18, - "column": 11 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 12 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Sub", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "superClass": { - "type": "Identifier", - "name": "BaseOverride", - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "TSParameterProperty", - "accessibility": "undefined", - "readonly": false, - "override": true, - "static": false, - "export": false, - "parameter": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 30 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Super", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 40 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "body": [], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 25, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_override4.ts b/es2panda/test/parser/ts/test_override4.ts deleted file mode 100644 index bfd970444c4fed4b9a4a30349b91117bedfa9503..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override4.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class BaseOverride { - foo = 1; -} - -class Sub extends BaseOverride { - constructor (override foo: number) { - super(); - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_override5-expected.txt b/es2panda/test/parser/ts/test_override5-expected.txt deleted file mode 100644 index 39376b987f0d63ac969c1c406cc8b669b7e8b3b1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override5-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Unexpected modifier [test_override5.ts:22:27] diff --git a/es2panda/test/parser/ts/test_override5.ts b/es2panda/test/parser/ts/test_override5.ts deleted file mode 100644 index 65d9643debfb66a903011ac9fb16c2d665f0ecbe..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override5.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class BaseOverride1 { - foo = 1; -} - -class Sub1 extends BaseOverride1 { - constructor (override public foo: number) { - super(); - } -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_override6-expected.txt b/es2panda/test/parser/ts/test_override6-expected.txt deleted file mode 100644 index 170be50dc5a53b70fd6628dd5b34287dedd1099a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override6-expected.txt +++ /dev/null @@ -1,73 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "FunctionDeclaration", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "override", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 23 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 23 - } - } -} diff --git a/es2panda/test/parser/ts/test_override6.ts b/es2panda/test/parser/ts/test_override6.ts deleted file mode 100644 index 18fd0f9114b638d2e4471855fe09f20076031bcf..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override6.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LIsCENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -function override() {} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_override7-expected.txt b/es2panda/test/parser/ts/test_override7-expected.txt deleted file mode 100644 index e191a3dbbdfc0cbdd649bc8a8241c74aa27d97ad..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override7-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. [test_override7.ts:18:14] diff --git a/es2panda/test/parser/ts/test_override7.ts b/es2panda/test/parser/ts/test_override7.ts deleted file mode 100644 index deac4c9f3cd26609c1e5b38305dc4ffa9202d740..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_override7.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A1 extends null { - override method1() {} -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies-expected.txt b/es2panda/test/parser/ts/test_satisfies-expected.txt deleted file mode 100644 index 79bf7968bc7eef57db02fd92843a01c2448fdc77..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies-expected.txt +++ /dev/null @@ -1,1681 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 25, - "column": 5 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 13 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 31 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t1", - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 15 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 17 - }, - "end": { - "line": 27, - "column": 18 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 12 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 27, - "column": 31 - }, - "end": { - "line": 27, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 31 - }, - "end": { - "line": 27, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 12 - }, - "end": { - "line": 27, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 27, - "column": 34 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 34 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t2", - "loc": { - "start": { - "line": 28, - "column": 7 - }, - "end": { - "line": 28, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 15 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 18 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 28, - "column": 14 - }, - "end": { - "line": 28, - "column": 18 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 28, - "column": 23 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 28, - "column": 20 - }, - "end": { - "line": 28, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 12 - }, - "end": { - "line": 28, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 28, - "column": 37 - }, - "end": { - "line": 28, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 37 - }, - "end": { - "line": 28, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 12 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 7 - }, - "end": { - "line": 28, - "column": 40 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t3", - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [], - "loc": { - "start": { - "line": 29, - "column": 12 - }, - "end": { - "line": 29, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "I1", - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 12 - }, - "end": { - "line": 29, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 7 - }, - "end": { - "line": 29, - "column": 29 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 29, - "column": 29 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t4", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 31, - "column": 11 - }, - "end": { - "line": 31, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 11 - }, - "end": { - "line": 31, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 31, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 19 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 31, - "column": 21 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T1", - "loc": { - "start": { - "line": 31, - "column": 37 - }, - "end": { - "line": 31, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 37 - }, - "end": { - "line": 31, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 16 - }, - "end": { - "line": 31, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 31, - "column": 40 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 31, - "column": 40 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t5", - "loc": { - "start": { - "line": 32, - "column": 7 - }, - "end": { - "line": 32, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 32, - "column": 14 - } - } - } - ], - "body": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 19 - } - } - }, - "property": { - "type": "Identifier", - "name": "substring", - "loc": { - "start": { - "line": 32, - "column": 20 - }, - "end": { - "line": 32, - "column": 29 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 29 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 32, - "column": 30 - }, - "end": { - "line": 32, - "column": 31 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 32, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 12 - }, - "end": { - "line": 32, - "column": 33 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "T2", - "loc": { - "start": { - "line": 32, - "column": 44 - }, - "end": { - "line": 32, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 44 - }, - "end": { - "line": 32, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 12 - }, - "end": { - "line": 32, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 7 - }, - "end": { - "line": 32, - "column": 47 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 47 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t6", - "loc": { - "start": { - "line": 34, - "column": 7 - }, - "end": { - "line": 34, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ArrayExpression", - "elements": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 14 - } - } - }, - { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 34, - "column": 16 - }, - "end": { - "line": 34, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 30 - }, - "end": { - "line": 34, - "column": 36 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 34, - "column": 38 - }, - "end": { - "line": 34, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 29 - }, - "end": { - "line": 34, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 7 - }, - "end": { - "line": 34, - "column": 46 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 34, - "column": 1 - }, - "end": { - "line": 34, - "column": 46 - } - } - }, - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 37, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 37, - "column": 8 - }, - "end": { - "line": 37, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 5 - }, - "end": { - "line": 38, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 36, - "column": 13 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 36, - "column": 11 - }, - "end": { - "line": 36, - "column": 12 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 36, - "column": 1 - }, - "end": { - "line": 38, - "column": 2 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t7", - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 7 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 39, - "column": 12 - }, - "end": { - "line": 39, - "column": 13 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 39, - "column": 15 - }, - "end": { - "line": 39, - "column": 21 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 39, - "column": 12 - }, - "end": { - "line": 39, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 39, - "column": 23 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 39, - "column": 34 - }, - "end": { - "line": 39, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 34 - }, - "end": { - "line": 39, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 39, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 36 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 39, - "column": 1 - }, - "end": { - "line": 39, - "column": 36 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "t8", - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 7 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 40, - "column": 12 - }, - "end": { - "line": 40, - "column": 13 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 40, - "column": 15 - }, - "end": { - "line": 40, - "column": 21 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 40, - "column": 12 - }, - "end": { - "line": 40, - "column": 21 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 40, - "column": 23 - }, - "end": { - "line": 40, - "column": 24 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "test", - "loc": { - "start": { - "line": 40, - "column": 26 - }, - "end": { - "line": 40, - "column": 32 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 40, - "column": 23 - }, - "end": { - "line": 40, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 40, - "column": 10 - }, - "end": { - "line": 40, - "column": 34 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 40, - "column": 45 - }, - "end": { - "line": 40, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 45 - }, - "end": { - "line": 40, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 10 - }, - "end": { - "line": 40, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 47 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 40, - "column": 1 - }, - "end": { - "line": 40, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 40, - "column": 47 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies.ts b/es2panda/test/parser/ts/test_satisfies.ts deleted file mode 100644 index 8bcdb7a4b8e126b2e2ebd241a11f0df6718ab6e3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface I1 { - a: number; -} - -type T1 = { - a: "a" | "b"; -} - -type T2 = (x: string) => void; - -const t1 = { a: 1 } satisfies I1; -const t2 = { a: 1, b: 1 } satisfies I1; -const t3 = { } satisfies I1; - -const t4: T1 = { a: "a" } satisfies T1; -const t5 = (m => m.substring(0)) satisfies T2; - -const t6 = [1, 2] satisfies [number, number]; - -interface A { - a: string -} -let t7 = { a: 'test' } satisfies A; -let t8 = { a: 'test', b: 'test' } satisfies A; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies1-expected.txt b/es2panda/test/parser/ts/test_satisfies1-expected.txt deleted file mode 100644 index 1472b1d9107840960cae00c4344e3f83c052d6b1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies1-expected.txt +++ /dev/null @@ -1,214 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ExportDefaultDeclaration", - "declaration": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Foo", - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 35 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 20, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 39 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies1.ts b/es2panda/test/parser/ts/test_satisfies1.ts deleted file mode 100644 index fe4022596c59b261876efd864707104ab8a0fd79..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface Foo { - a: number; -} -export default { a: 1 } satisfies Foo; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies10-expected.txt b/es2panda/test/parser/ts/test_satisfies10-expected.txt deleted file mode 100644 index 8de8cd84ebc730888c43a34e3cd2efbdc17a6145..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies10-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: Type expected [test_satisfies10.ts:17:26] diff --git a/es2panda/test/parser/ts/test_satisfies10.ts b/es2panda/test/parser/ts/test_satisfies10.ts deleted file mode 100644 index 24caa28ad56ea57eca5b91ad21610178f6f10c57..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies10.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const M = 'str' satisfies; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies11-expected.txt b/es2panda/test/parser/ts/test_satisfies11-expected.txt deleted file mode 100644 index b5618868f5d3a6b644720fbb63d11907c062f9b0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies11-expected.txt +++ /dev/null @@ -1,408 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a1", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "init": { - "type": "ArrayExpression", - "elements": [ - { - "type": "StringLiteral", - "value": "111", - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 27 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "e1", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - { - "type": "ForOfStatement", - "await": false, - "left": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "Identifier", - "name": "e1", - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "typeAnnotation": { - "type": "TSParenthesizedType", - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - { - "type": "TSUndefinedKeyword", - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "right": { - "type": "Identifier", - "name": "a1", - "loc": { - "start": { - "line": 19, - "column": 44 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "console", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "log", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "e1", - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 19 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 47 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 21, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies11.ts b/es2panda/test/parser/ts/test_satisfies11.ts deleted file mode 100644 index 6543a601d4a9f81fac20f6ef2fbd20b3b64dd8ac..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies11.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let a1: string[] = ['111'] -let e1: string | undefined; -for((e1 satisfies (string | undefined)) of a1){ - console.log(e1); -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies12-expected.txt b/es2panda/test/parser/ts/test_satisfies12-expected.txt deleted file mode 100644 index 272ac29a0f3862670ea01c464e1bf9362078dbfe..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies12-expected.txt +++ /dev/null @@ -1,125 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "satisfies", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 18 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "Identifier", - "name": "satisfies", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 28 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies12.ts b/es2panda/test/parser/ts/test_satisfies12.ts deleted file mode 100644 index 662758988c66c733dc7a3b8c55f9b7b4c821bed4..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies12.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let satisfies = 1; -satisfies satisfies number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies13-expected.txt b/es2panda/test/parser/ts/test_satisfies13-expected.txt deleted file mode 100644 index da5d0b76a16f1ca358a4d543d2978f168a971ec8..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies13-expected.txt +++ /dev/null @@ -1,153 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "cd", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 7 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 11 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "cd", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 3 - } - } - }, - "right": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 25 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies13.ts b/es2panda/test/parser/ts/test_satisfies13.ts deleted file mode 100644 index 0e31b9e13a41e2203426dc0ee075dc566220f430..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies13.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let cd = 1; -cd = 4 satisfies number; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies14-expected.txt b/es2panda/test/parser/ts/test_satisfies14-expected.txt deleted file mode 100644 index 42aebe57d532eded1575433270427a25a3ea1362..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies14-expected.txt +++ /dev/null @@ -1,164 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "StringLiteral", - "value": "abc", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "abc", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 41 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 57 - } - } - }, - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 58 - }, - "end": { - "line": 17, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 65 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 65 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 65 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies14.ts b/es2panda/test/parser/ts/test_satisfies14.ts deleted file mode 100644 index 1dc2cf5eee4b9e406fe6066a79db3a146160350e..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies14.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let a = "abc" satisfies "abc" satisfies string satisfies string; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies2-expected.txt b/es2panda/test/parser/ts/test_satisfies2-expected.txt deleted file mode 100644 index 153cac03cf117ca0c88350ae9ea0898c95222ea1..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies2-expected.txt +++ /dev/null @@ -1,546 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Predicates", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "n", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 36 - } - } - } - ], - "returnType": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 49 - }, - "end": { - "line": 17, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 56 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 58 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 59 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "isEven", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 11 - } - } - }, - "value": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 14 - } - } - } - ], - "body": { - "type": "BinaryExpression", - "operator": "===", - "left": { - "type": "BinaryExpression", - "operator": "%", - "left": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 19 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "isOdd", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "value": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": true, - "params": [ - { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 13 - } - } - } - ], - "body": { - "type": "BinaryExpression", - "operator": "===", - "left": { - "type": "BinaryExpression", - "operator": "%", - "left": { - "type": "Identifier", - "name": "n", - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Predicates", - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 22, - "column": 24 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 22, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 24 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies2.ts b/es2panda/test/parser/ts/test_satisfies2.ts deleted file mode 100644 index 2230525c56c8e31daf2db8c6ac4a6c22d23a5cc7..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies2.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Predicates = { [s: string]: (n: number) => boolean }; - -const p = { - isEven: n => n % 2 === 0, - isOdd: n => n % 2 === 1 -} satisfies Predicates; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies3-expected.txt b/es2panda/test/parser/ts/test_satisfies3-expected.txt deleted file mode 100644 index 91a53e4f269a7dbf8584a2eda1c3250d9817e883..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies3-expected.txt +++ /dev/null @@ -1,830 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "obj", - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 15 - } - } - } - ], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 48 - } - } - }, - { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 17, - "column": 50 - }, - "end": { - "line": 17, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 41 - }, - "end": { - "line": 17, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 35 - }, - "end": { - "line": 17, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 8 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "g", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 13 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 61 - }, - "end": { - "line": 20, - "column": 2 - } - } - }, - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "g", - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 20 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 18 - } - } - } - ], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 20, - "column": 29 - }, - "end": { - "line": 20, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 44 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 20, - "column": 45 - }, - "end": { - "line": 20, - "column": 51 - } - } - }, - { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 20, - "column": 53 - }, - "end": { - "line": 20, - "column": 60 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 44 - }, - "end": { - "line": 20, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 44 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 61 - }, - "end": { - "line": 20, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 20, - "column": 62 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 20, - "column": 62 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 5 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 7 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "f", - "loc": { - "start": { - "line": 22, - "column": 28 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 33 - }, - "end": { - "line": 22, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 30 - }, - "end": { - "line": 22, - "column": 31 - } - } - } - ], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 22, - "column": 42 - }, - "end": { - "line": 22, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 28 - }, - "end": { - "line": 22, - "column": 48 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1 - }, - "end": { - "line": 22, - "column": 49 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 22, - "column": 49 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies3.ts b/es2panda/test/parser/ts/test_satisfies3.ts deleted file mode 100644 index 8d1738033736c87f60d7b041c1df9d6fe6f9ef99..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies3.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -let obj: { f(s: string): void } & Record = { - f(s) { }, - g(s) { } -} satisfies { g(s: string): void } & Record; - -({ f(x) { } }) satisfies { f(s: string): void }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies4-expected.txt b/es2panda/test/parser/ts/test_satisfies4-expected.txt deleted file mode 100644 index 5de567ea2d7656e8794852efd38a6eb3843a7721..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies4-expected.txt +++ /dev/null @@ -1,554 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Movable", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSMethodSignature", - "computed": false, - "optional": false, - "isGetAccessor": false, - "isSetAccessor": false, - "key": { - "type": "Identifier", - "name": "move", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, - "params": [ - { - "type": "Identifier", - "name": "distance", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 18 - } - } - } - ], - "typeAnnotation": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 3 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "car", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 10 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "start", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "move", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 9 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 11 - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - { - "type": "Property", - "method": true, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "stop", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 9 - } - } - }, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 26, - "column": 12 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 27, - "column": 2 - } - } - }, - "typeAnnotation": { - "type": "TSIntersectionType", - "types": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Movable", - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 27, - "column": 30 - }, - "end": { - "line": 27, - "column": 36 - } - } - }, - { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 27, - "column": 38 - }, - "end": { - "line": 27, - "column": 45 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 29 - }, - "end": { - "line": 27, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 23 - }, - "end": { - "line": 27, - "column": 29 - } - } - } - ], - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 27, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 27, - "column": 47 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 27, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 27, - "column": 47 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies4.ts b/es2panda/test/parser/ts/test_satisfies4.ts deleted file mode 100644 index 0cc29c345f907acf7947a834cf57976c3f2c43a6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies4.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Movable = { - move(distance: number): void; -}; - -const car = { - start() { }, - move(d) { - // d should be number - }, - stop() { } -} satisfies Movable & Record; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies5-expected.txt b/es2panda/test/parser/ts/test_satisfies5-expected.txt deleted file mode 100644 index e7e4809deb6ebb6fe9908c1961310206902e01d6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies5-expected.txt +++ /dev/null @@ -1,112 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "v", - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "Identifier", - "name": "undefined", - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 31 - } - } - } - ], - "kind": "var", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 17, - "column": 31 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies5.ts b/es2panda/test/parser/ts/test_satisfies5.ts deleted file mode 100644 index 6843d94a577924299216dd31415d1575f7ef3321..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies5.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var v = undefined satisfies 1; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies6-expected.txt b/es2panda/test/parser/ts/test_satisfies6-expected.txt deleted file mode 100644 index ca2f28f02e1018fcf9a015da02bce264508a34c2..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies6-expected.txt +++ /dev/null @@ -1,573 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Point2d", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 19 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 17, - "column": 32 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 10, - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Partial", - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Point2d", - "loc": { - "start": { - "line": 19, - "column": 39 - }, - "end": { - "line": 19, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 39 - }, - "end": { - "line": 19, - "column": 46 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 19, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 48 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 19, - "column": 48 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "console", - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "property": { - "type": "Identifier", - "name": "log", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "arguments": [ - { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "property": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "property": { - "type": "Identifier", - "name": "toFixed", - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 26 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "y", - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 12 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 23, - "column": 1 - }, - "end": { - "line": 23, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 13 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies6.ts b/es2panda/test/parser/ts/test_satisfies6.ts deleted file mode 100644 index 0a8d223f4e67d9a2943184af2b994dfe026b027a..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies6.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Point2d = { x: number, y: number }; - -const a = { x: 10 } satisfies Partial; - -console.log(a.x.toFixed()); - -let p = a.y; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies7-expected.txt b/es2panda/test/parser/ts/test_satisfies7-expected.txt deleted file mode 100644 index 12e36bb0fd17ecc32544e6d401caa51080a327f0..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies7-expected.txt +++ /dev/null @@ -1,856 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Keys", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "a", - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "b", - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "c", - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "d", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 34 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 9 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "hello", - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 8, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 9 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 9 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Partial", - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Record", - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Keys", - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - { - "type": "TSUnknownKeyword", - "loc": { - "start": { - "line": 23, - "column": 34 - }, - "end": { - "line": 23, - "column": 41 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 27 - }, - "end": { - "line": 23, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 27 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 23, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 23, - "column": 44 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 23, - "column": 44 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "toFixed", - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 20 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 20 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 22 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "substring", - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 23 - }, - "end": { - "line": 26, - "column": 24 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 25 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 26, - "column": 1 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "p", - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "d", - "loc": { - "start": { - "line": 27, - "column": 11 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 12 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 13 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 27, - "column": 13 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies7.ts b/es2panda/test/parser/ts/test_satisfies7.ts deleted file mode 100644 index 2de94bc91c01b96ade63c532a69dc08d3ade1e78..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies7.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Keys = 'a' | 'b' | 'c' | 'd'; - -const p = { - a: 0, - b: "hello", - x: 8 -} satisfies Partial>; - -let a = p.a.toFixed(); -let b = p.b.substring(1); -let d = p.d; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies8-expected.txt b/es2panda/test/parser/ts/test_satisfies8-expected.txt deleted file mode 100644 index 0d4c1b8556d0341db66936a8bc41e4528bc68a1b..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies8-expected.txt +++ /dev/null @@ -1,915 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "Facts", - "loc": { - "start": { - "line": 17, - "column": 6 - }, - "end": { - "line": 17, - "column": 11 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSIndexSignature", - "parameters": { - "type": "Identifier", - "name": "key", - "typeAnnotation": { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 38 - } - } - }, - "readonly": false, - "static": false, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 40 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "checkTruths", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Facts", - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 30 - }, - "end": { - "line": 18, - "column": 31 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 46 - } - } - }, - { - "type": "TSDeclareFunction", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "checkM", - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "x", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 31 - } - } - }, - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 42 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 26 - } - } - } - ], - "returnType": { - "type": "TSVoidKeyword", - "loc": { - "start": { - "line": 19, - "column": 45 - }, - "end": { - "line": 19, - "column": 49 - } - } - }, - "declare": true, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 50 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 20, - "column": 7 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "init": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "value": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 12 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 11 - }, - "end": { - "line": 22, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 7 - }, - "end": { - "line": 22, - "column": 2 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 20, - "column": 1 - }, - "end": { - "line": 22, - "column": 3 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "checkTruths", - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 24, - "column": 13 - }, - "end": { - "line": 24, - "column": 14 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "checkM", - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 7 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 25, - "column": 8 - }, - "end": { - "line": 25, - "column": 9 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 1 - }, - "end": { - "line": 25, - "column": 11 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "m", - "typeAnnotation": { - "type": "TSBooleanKeyword", - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 27, - "column": 8 - } - } - }, - "init": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 21 - } - } - }, - "property": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 27, - "column": 22 - }, - "end": { - "line": 27, - "column": 23 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 7 - }, - "end": { - "line": 27, - "column": 23 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 27, - "column": 1 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "M", - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 7 - } - } - }, - "typeAnnotation": { - "type": "TSTypeOperator", - "operator": "keyof", - "typeAnnotation": { - "type": "TSTypeQuery", - "exprName": { - "type": "Identifier", - "name": "x", - "loc": { - "start": { - "line": 29, - "column": 23 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 1 - }, - "end": { - "line": 29, - "column": 25 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "x2", - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 31, - "column": 9 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "m", - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "value": { - "type": "BooleanLiteral", - "value": true, - "loc": { - "start": { - "line": 32, - "column": 8 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "s", - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "false", - "loc": { - "start": { - "line": 33, - "column": 8 - }, - "end": { - "line": 33, - "column": 15 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 12 - }, - "end": { - "line": 34, - "column": 2 - } - } - }, - "typeAnnotation": { - "type": "TSTypeReference", - "typeName": { - "type": "Identifier", - "name": "Facts", - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 12 - }, - "end": { - "line": 34, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 7 - }, - "end": { - "line": 34, - "column": 19 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 31, - "column": 1 - }, - "end": { - "line": 34, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 34, - "column": 19 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies8.ts b/es2panda/test/parser/ts/test_satisfies8.ts deleted file mode 100644 index 3aead0a2d2b891773438ee2fab98a21d1293bab3..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies8.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -type Facts = { [key: string]: boolean }; -declare function checkTruths(x: Facts): void; -declare function checkM(x: { m: boolean }): void; -const x = { - m: true -}; - -checkTruths(x); -checkM(x); - -const m: boolean = x.m; - -type M = keyof typeof x; - -const x2 = { - m: true, - s: "false" -} satisfies Facts; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_satisfies9-expected.txt b/es2panda/test/parser/ts/test_satisfies9-expected.txt deleted file mode 100644 index 1a68d604206487b6866273bd60689d9a00294bed..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies9-expected.txt +++ /dev/null @@ -1,483 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "baz", - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 42 - }, - "end": { - "line": 17, - "column": 47 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 48 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 17, - "column": 48 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "xyz", - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "typeAnnotation": { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "baz", - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 24 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "init": { - "type": "TSSatisfiesExpression", - "expression": { - "type": "ObjectExpression", - "properties": [ - { - "type": "Property", - "method": false, - "shorthand": false, - "computed": false, - "key": { - "type": "Identifier", - "name": "xyz", - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 18, - "column": 34 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "kind": "init", - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "typeAnnotation": { - "type": "TSTypeLiteral", - "members": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "xyz", - "loc": { - "start": { - "line": 18, - "column": 54 - }, - "end": { - "line": 18, - "column": 57 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 18, - "column": 59 - }, - "end": { - "line": 18, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 59 - }, - "end": { - "line": 18, - "column": 64 - } - } - }, - { - "type": "TSLiteralType", - "literal": { - "type": "StringLiteral", - "value": "bar", - "loc": { - "start": { - "line": 18, - "column": 67 - }, - "end": { - "line": 18, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 67 - }, - "end": { - "line": 18, - "column": 72 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 59 - }, - "end": { - "line": 18, - "column": 72 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 54 - }, - "end": { - "line": 18, - "column": 74 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 52 - }, - "end": { - "line": 18, - "column": 74 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 75 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 75 - } - } - } - ], - "kind": "const", - "loc": { - "start": { - "line": 18, - "column": 1 - }, - "end": { - "line": 18, - "column": 75 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 18, - "column": 75 - } - } -} diff --git a/es2panda/test/parser/ts/test_satisfies9.ts b/es2panda/test/parser/ts/test_satisfies9.ts deleted file mode 100644 index 8a1516d66053623821091018e78b69b01801479c..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_satisfies9.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -const a: "baz" = "foo" satisfies "foo" | "bar"; -const b: { xyz: "baz" } = { xyz: "foo" } satisfies { xyz: "foo" | "bar" }; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_this_type-expected.txt b/es2panda/test/parser/ts/test_this_type-expected.txt deleted file mode 100644 index 944380457a23fa370552172ba96c00f6b1745fc6..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_this_type-expected.txt +++ /dev/null @@ -1,424 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "TSPropertySignature", - "computed": false, - "optional": false, - "readonly": false, - "key": { - "type": "Identifier", - "name": "a", - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "typeAnnotation": { - "type": "TSUnionType", - "types": [ - { - "type": "TSThisType", - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 12 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 21 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 8 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "id": { - "type": "Identifier", - "name": "alma", - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "loc": { - "start": { - "line": 21, - "column": 7 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "constructor": { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "b", - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - }, - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "TSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "TSTupleType", - "elementTypes": [ - { - "type": "TSUnionType", - "types": [ - { - "type": "TSStringKeyword", - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - { - "type": "TSNumberKeyword", - "loc": { - "start": { - "line": 22, - "column": 33 - }, - "end": { - "line": 22, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 39 - } - } - }, - { - "type": "TSTypeLiteral", - "members": [], - "loc": { - "start": { - "line": 22, - "column": 41 - }, - "end": { - "line": 22, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 20 - }, - "end": { - "line": 22, - "column": 21 - } - } - } - ], - "returnType": { - "type": "TSThisType", - "loc": { - "start": { - "line": 22, - "column": 49 - }, - "end": { - "line": 22, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 53 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - } - } - ], - "indexSignatures": [], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 23, - "column": 2 - } - } -} diff --git a/es2panda/test/parser/ts/test_this_type.ts b/es2panda/test/parser/ts/test_this_type.ts deleted file mode 100644 index b8bf54706123a736f7a9452e268b0810cef93447..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_this_type.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -interface alma { - a: this | number, -} - -class A { - b: (a: number, b: [string | number, {}]) => this; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_this_type1-expected.txt b/es2panda/test/parser/ts/test_this_type1-expected.txt deleted file mode 100644 index ea46ab28967a99e71d035c9151e60a7b78147202..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_this_type1-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'this' type is available only in a non-static member of a class or interface. [test_this_type1.ts:17:8] diff --git a/es2panda/test/parser/ts/test_this_type1.ts b/es2panda/test/parser/ts/test_this_type1.ts deleted file mode 100644 index 693b272d0a0a9c10ff0cbb03d1d4ce55fdb892db..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_this_type1.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -var a: this; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test_this_type2-expected.txt b/es2panda/test/parser/ts/test_this_type2-expected.txt deleted file mode 100644 index 4694012f811d904b8ef1d666744bbd92443ceb5f..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_this_type2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -SyntaxError: A 'this' type is available only in a non-static member of a class or interface. [test_this_type2.ts:18:24] diff --git a/es2panda/test/parser/ts/test_this_type2.ts b/es2panda/test/parser/ts/test_this_type2.ts deleted file mode 100644 index a0b18c106fbd86d0217e4caa213e09a12159ec53..0000000000000000000000000000000000000000 --- a/es2panda/test/parser/ts/test_this_type2.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -class A { - static a: number | this; -} \ No newline at end of file diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_1-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_1-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_1.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_1.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_1.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_10-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_10-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_10.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_10.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_10.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_11-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_11-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_11.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_11.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_11.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_12-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_12-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_12.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_12.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_12.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_13-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_13-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_13.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_13.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_13.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_14-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_14-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_14.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_14.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_14.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_15-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_15-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_15.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_15.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_15.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_16-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_16-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_16.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_16.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_16.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_17-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_17-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_17.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_17.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_17.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_18-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_18-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_18.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_18.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_18.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_19-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_19-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_19.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_19.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_19.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_2-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_2-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_2.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_2.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_2.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_20-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_20-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_20.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_20.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_20.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_21-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_21-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_21.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_21.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_21.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_22-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_22-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_22.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_22.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_22.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_23-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_23-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_23.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_23.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_23.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_24-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_24-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_24.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_24.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_24.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_25-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_25-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_25-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_25-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_25.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_25.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_25.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_25.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_26-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_26-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_26-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_26-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_26.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_26.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_26.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_26.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_27-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_27-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_27-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_27-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_27.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_27.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_27.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_27.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_28-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_28-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_28-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_28-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_28.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_28.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_28.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_28.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_29-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_29-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_29-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_29-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_29.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_29.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_29.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_29.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_3-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_3-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_3.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_3.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_3.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_30-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_30-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_30-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_30-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_30.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_30.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_30.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_30.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_31-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_31-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_31-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_31-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_31.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_31.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_31.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_31.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_32-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_32-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_32-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_32-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_32.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_32.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_32.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_32.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_33-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_33-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_33-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_33-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_33.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_33.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_33.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_33.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_34-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_34-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_34-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_34-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_34.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_34.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_34.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_34.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_35-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_35-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_35-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_35-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_35.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_35.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_35.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_35.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_36-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_36-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_36-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_36-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_36.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_36.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_36.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_36.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_37-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_37-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_37-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_37-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_37.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_37.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_37.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_37.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_38-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_38-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_38-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_38-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_38.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_38.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_38.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_38.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_39-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_39-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_39-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_39-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_39.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_39.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_39.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_39.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_4-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_4-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_4.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_4.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_4.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_40-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_40-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_40-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_40-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_40.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_40.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_40.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_40.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_41-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_41-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_41-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_41-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_41.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_41.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_41.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_41.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_42-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_42-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_42-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_42-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_42.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_42.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_42.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_42.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_43-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_43-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_43-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_43-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_43.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_43.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_43.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_43.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_44-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_44-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_44-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_44-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_44.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_44.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_44.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_44.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_45-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_45-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_45-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_45-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_45.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_45.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_45.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_45.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_46-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_46-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_46-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_46-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_46.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_46.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_46.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_46.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_47-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_47-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_47-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_47-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_47.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_47.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_47.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_47.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_48-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_48-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_48-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_48-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_48.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_48.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_48.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_48.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_49-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_49-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_49-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_49-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_49.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_49.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_49.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_49.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_5-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_5-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_5.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_5.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_5.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_50-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_50-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_50-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_50-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_50.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_50.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_50.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_50.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_51-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_51-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_51-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_51-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_51.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_51.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_51.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_51.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_52-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_52-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_52-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_52-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_52.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_52.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_52.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_52.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_53-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_53-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_53-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_53-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_53.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_53.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_53.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_53.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_54-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_54-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_54-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_54-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_54.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_54.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_54.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_54.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_55-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_55-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_55-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_55-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_55.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_55.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_55.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_55.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_56-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_56-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_56-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_56-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_56.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_56.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_56.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_56.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_57-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_57-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_57-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_57-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_57.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_57.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_57.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_57.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_58-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_58-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_58-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_58-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_58.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_58.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_58.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_58.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_59-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_59-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_59-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_59-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_59.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_59.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_59.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_59.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_6-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_6-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_6.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_6.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_6.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_60-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_60-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_60-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_60-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_60.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_60.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_60.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_60.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_61-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_61-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_61-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_61-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_61.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_61.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_61.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_61.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_62-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_62-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_62-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_62-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_62.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_62.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_62.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_62.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_63-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_63-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_63-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_63-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_63.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_63.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_63.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_63.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_64-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_64-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_64-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_64-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_64.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_64.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_64.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_64.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_7-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_7-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_7.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_7.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_7.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_8-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_8-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_8.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_8.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_8.ts diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_9-expected.txt b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_9-expected.txt rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arithmetic_operators_9.ts b/es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arithmetic_operators_9.ts rename to es2panda/test/parser/ts/type_checker/arithmetic_operators/arithmetic_operators_9.ts diff --git a/es2panda/test/parser/ts/type_checker/array_1-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_1-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_1.ts b/es2panda/test/parser/ts/type_checker/array/array_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_1.ts rename to es2panda/test/parser/ts/type_checker/array/array_1.ts diff --git a/es2panda/test/parser/ts/type_checker/array_10-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_10-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_10.ts b/es2panda/test/parser/ts/type_checker/array/array_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_10.ts rename to es2panda/test/parser/ts/type_checker/array/array_10.ts diff --git a/es2panda/test/parser/ts/type_checker/array_11-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_11-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_11.ts b/es2panda/test/parser/ts/type_checker/array/array_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_11.ts rename to es2panda/test/parser/ts/type_checker/array/array_11.ts diff --git a/es2panda/test/parser/ts/type_checker/array_12-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_12-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_12.ts b/es2panda/test/parser/ts/type_checker/array/array_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_12.ts rename to es2panda/test/parser/ts/type_checker/array/array_12.ts diff --git a/es2panda/test/parser/ts/type_checker/array_13-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_13-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_13.ts b/es2panda/test/parser/ts/type_checker/array/array_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_13.ts rename to es2panda/test/parser/ts/type_checker/array/array_13.ts diff --git a/es2panda/test/parser/ts/type_checker/array_14-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_14-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_14.ts b/es2panda/test/parser/ts/type_checker/array/array_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_14.ts rename to es2panda/test/parser/ts/type_checker/array/array_14.ts diff --git a/es2panda/test/parser/ts/type_checker/array_15-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_15-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_15.ts b/es2panda/test/parser/ts/type_checker/array/array_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_15.ts rename to es2panda/test/parser/ts/type_checker/array/array_15.ts diff --git a/es2panda/test/parser/ts/type_checker/array_16-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_16-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_16.ts b/es2panda/test/parser/ts/type_checker/array/array_16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_16.ts rename to es2panda/test/parser/ts/type_checker/array/array_16.ts diff --git a/es2panda/test/parser/ts/type_checker/array_17-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_17-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_17.ts b/es2panda/test/parser/ts/type_checker/array/array_17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_17.ts rename to es2panda/test/parser/ts/type_checker/array/array_17.ts diff --git a/es2panda/test/parser/ts/type_checker/array_18-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_18-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_18.ts b/es2panda/test/parser/ts/type_checker/array/array_18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_18.ts rename to es2panda/test/parser/ts/type_checker/array/array_18.ts diff --git a/es2panda/test/parser/ts/type_checker/array_19-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_19-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_19.ts b/es2panda/test/parser/ts/type_checker/array/array_19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_19.ts rename to es2panda/test/parser/ts/type_checker/array/array_19.ts diff --git a/es2panda/test/parser/ts/type_checker/array_2-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_2-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_2.ts b/es2panda/test/parser/ts/type_checker/array/array_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_2.ts rename to es2panda/test/parser/ts/type_checker/array/array_2.ts diff --git a/es2panda/test/parser/ts/type_checker/array_20-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_20-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_20.ts b/es2panda/test/parser/ts/type_checker/array/array_20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_20.ts rename to es2panda/test/parser/ts/type_checker/array/array_20.ts diff --git a/es2panda/test/parser/ts/type_checker/array_21-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_21-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_21.ts b/es2panda/test/parser/ts/type_checker/array/array_21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_21.ts rename to es2panda/test/parser/ts/type_checker/array/array_21.ts diff --git a/es2panda/test/parser/ts/type_checker/array_22-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_22-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_22.ts b/es2panda/test/parser/ts/type_checker/array/array_22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_22.ts rename to es2panda/test/parser/ts/type_checker/array/array_22.ts diff --git a/es2panda/test/parser/ts/type_checker/array_23-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_23-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_23.ts b/es2panda/test/parser/ts/type_checker/array/array_23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_23.ts rename to es2panda/test/parser/ts/type_checker/array/array_23.ts diff --git a/es2panda/test/parser/ts/type_checker/array_24-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_24-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_24.ts b/es2panda/test/parser/ts/type_checker/array/array_24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_24.ts rename to es2panda/test/parser/ts/type_checker/array/array_24.ts diff --git a/es2panda/test/parser/ts/type_checker/array_3-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_3-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_3.ts b/es2panda/test/parser/ts/type_checker/array/array_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_3.ts rename to es2panda/test/parser/ts/type_checker/array/array_3.ts diff --git a/es2panda/test/parser/ts/type_checker/array_4-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_4-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_4.ts b/es2panda/test/parser/ts/type_checker/array/array_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_4.ts rename to es2panda/test/parser/ts/type_checker/array/array_4.ts diff --git a/es2panda/test/parser/ts/type_checker/array_5-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_5-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_5.ts b/es2panda/test/parser/ts/type_checker/array/array_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_5.ts rename to es2panda/test/parser/ts/type_checker/array/array_5.ts diff --git a/es2panda/test/parser/ts/type_checker/array_6-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_6-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_6.ts b/es2panda/test/parser/ts/type_checker/array/array_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_6.ts rename to es2panda/test/parser/ts/type_checker/array/array_6.ts diff --git a/es2panda/test/parser/ts/type_checker/array_7-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_7-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_7.ts b/es2panda/test/parser/ts/type_checker/array/array_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_7.ts rename to es2panda/test/parser/ts/type_checker/array/array_7.ts diff --git a/es2panda/test/parser/ts/type_checker/array_8-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_8-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_8.ts b/es2panda/test/parser/ts/type_checker/array/array_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_8.ts rename to es2panda/test/parser/ts/type_checker/array/array_8.ts diff --git a/es2panda/test/parser/ts/type_checker/array_9-expected.txt b/es2panda/test/parser/ts/type_checker/array/array_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_9-expected.txt rename to es2panda/test/parser/ts/type_checker/array/array_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/array_9.ts b/es2panda/test/parser/ts/type_checker/array/array_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/array_9.ts rename to es2panda/test/parser/ts/type_checker/array/array_9.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring1-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring1-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring1.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring1.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring1.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring10-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring10-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring10.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring10.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring10.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring11-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring11-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring11.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring11.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring11.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring12-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring12-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring12.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring12.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring12.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring13-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring13-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring13.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring13.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring13.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring14-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring14-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring14.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring14.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring14.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring15-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring15-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring15.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring15.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring15.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring16-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring16-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring16.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring16.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring16.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring17-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring17-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring17.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring17.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring17.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring18-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring18-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring18.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring18.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring18.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring19-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring19-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring19.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring19.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring19.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring2-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring2-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring2.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring2.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring2.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring20-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring20-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring20.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring20.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring20.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring21-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring21-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring21.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring21.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring21.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring22-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring22-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring22.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring22.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring22.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring23-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring23-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring23.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring23.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring23.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring24-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring24-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring24.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring24.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring24.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring3-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring3-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring3.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring3.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring3.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring4-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring4-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring4.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring4.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring4.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring5-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring5-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring5.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring5.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring5.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring6-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring6-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring6.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring6.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring6.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring7-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring7-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring7.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring7.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring7.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring8-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring8-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring8.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring8.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring8.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring9-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring9-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring9.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring9.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing/arrayDestructuring9.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring25-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring25-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring25-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring25-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring25.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring25.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring25.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring25.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring26-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring26-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring26-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring26-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring26.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring26.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring26.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring26.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring27-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring27-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring27-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring27-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring27.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring27.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring27.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring27.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring28-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring28-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring28-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring28-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring28.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring28.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring28.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring28.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring29-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring29-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring29-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring29-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring29.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring29.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring29.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring29.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring30-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring30-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring30-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring30-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring30.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring30.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring30.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring30.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring31-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring31-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring31-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring31-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring31.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring31.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring31.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring31.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring32-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring32-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring32-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring32-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring32.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring32.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring32.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring32.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring33-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring33-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring33-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring33-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring33.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring33.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring33.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring33.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring34-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring34-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring34-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring34-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring34.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring34.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring34.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring34.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring35-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring35-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring35-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring35-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring35.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring35.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring35.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring35.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring36-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring36-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring36-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring36-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring36.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring36.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring36.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring36.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring37-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring37-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring37-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring37-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring37.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring37.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring37.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring37.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring38-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring38-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring38-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring38-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring38.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring38.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring38.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring38.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring39-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring39-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring39-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring39-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring39.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring39.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring39.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring39.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring40-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring40-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring40-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring40-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring40.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring40.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring40.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring40.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring41-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring41-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring41-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring41-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring41.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring41.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring41.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring41.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring42-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring42-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring42-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring42-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring42.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring42.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring42.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring42.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring43-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring43-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring43-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring43-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring43.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring43.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring43.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring43.ts diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring44-expected.txt b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring44-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring44-expected.txt rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring44-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/arrayDestructuring44.ts b/es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring44.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/arrayDestructuring44.ts rename to es2panda/test/parser/ts/type_checker/arrayDestructing_2/arrayDestructuring44.ts diff --git a/es2panda/test/parser/ts/type_checker/assignment_never-expected.txt b/es2panda/test/parser/ts/type_checker/assignment/assignment_never-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/assignment_never-expected.txt rename to es2panda/test/parser/ts/type_checker/assignment/assignment_never-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/assignment_never.ts b/es2panda/test/parser/ts/type_checker/assignment/assignment_never.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/assignment_never.ts rename to es2panda/test/parser/ts/type_checker/assignment/assignment_never.ts diff --git a/es2panda/test/parser/ts/type_checker/assignment_unknown-expected.txt b/es2panda/test/parser/ts/type_checker/assignment/assignment_unknown-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/assignment_unknown-expected.txt rename to es2panda/test/parser/ts/type_checker/assignment/assignment_unknown-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/assignment_unknown.ts b/es2panda/test/parser/ts/type_checker/assignment/assignment_unknown.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/assignment_unknown.ts rename to es2panda/test/parser/ts/type_checker/assignment/assignment_unknown.ts diff --git a/es2panda/test/parser/ts/type_checker/cannotAssignToConst-expected.txt b/es2panda/test/parser/ts/type_checker/cannotAssignToConst/cannotAssignToConst-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/cannotAssignToConst-expected.txt rename to es2panda/test/parser/ts/type_checker/cannotAssignToConst/cannotAssignToConst-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/cannotAssignToConst.ts b/es2panda/test/parser/ts/type_checker/cannotAssignToConst/cannotAssignToConst.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/cannotAssignToConst.ts rename to es2panda/test/parser/ts/type_checker/cannotAssignToConst/cannotAssignToConst.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_1-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_1-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_1.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_1.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_1.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_10-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_10-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_10.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_10.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_10.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_11-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_11-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_11.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_11.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_11.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_12-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_12-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_12.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_12.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_12.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_13-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_13-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_13.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_13.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_13.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_14-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_14-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_14.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_14.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_14.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_15-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_15-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_15.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_15.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_15.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_2-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_2-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_2.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_2.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_2.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_3-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_3-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_3.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_3.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_3.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_4-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_4-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_4.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_4.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_4.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_5-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_5-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_5.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_5.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_5.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_6-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_6-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_6.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_6.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_6.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_7-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_7-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_7.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_7.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_7.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_8-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_8-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_8.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_8.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_8.ts diff --git a/es2panda/test/parser/ts/type_checker/as_expression_9-expected.txt b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_9-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/as_expression_9.ts b/es2panda/test/parser/ts/type_checker/expression/as/as_expression_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/as_expression_9.ts rename to es2panda/test/parser/ts/type_checker/expression/as/as_expression_9.ts diff --git a/es2panda/test/parser/ts/type_checker/expression_1-expected.txt b/es2panda/test/parser/ts/type_checker/expression/expression_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_1-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/expression_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/expression_1.ts b/es2panda/test/parser/ts/type_checker/expression/expression_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_1.ts rename to es2panda/test/parser/ts/type_checker/expression/expression_1.ts diff --git a/es2panda/test/parser/ts/type_checker/expression_2-expected.txt b/es2panda/test/parser/ts/type_checker/expression/expression_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_2-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/expression_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/expression_2.ts b/es2panda/test/parser/ts/type_checker/expression/expression_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_2.ts rename to es2panda/test/parser/ts/type_checker/expression/expression_2.ts diff --git a/es2panda/test/parser/ts/type_checker/expression_3-expected.txt b/es2panda/test/parser/ts/type_checker/expression/expression_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_3-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/expression_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/expression_3.ts b/es2panda/test/parser/ts/type_checker/expression/expression_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_3.ts rename to es2panda/test/parser/ts/type_checker/expression/expression_3.ts diff --git a/es2panda/test/parser/ts/type_checker/expression_4-expected.txt b/es2panda/test/parser/ts/type_checker/expression/expression_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_4-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/expression_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/expression_4.ts b/es2panda/test/parser/ts/type_checker/expression/expression_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/expression_4.ts rename to es2panda/test/parser/ts/type_checker/expression/expression_4.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_1-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_1-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_1.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_1.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_1.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_10-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_10-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_10.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_10.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_10.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_11-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_11-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_11.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_11.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_11.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_12-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_12-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_12.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_12.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_12.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_13-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_13-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_13.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_13.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_13.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_14-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_14-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_14.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_14.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_14.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_15-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_15-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_15.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_15.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_15.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_16-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_16-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_16.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_16.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_16.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_17-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_17-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_17.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_17.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_17.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_18-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_18-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_18.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_18.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_18.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_19-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_19-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_19.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_19.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_19.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_2-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_2-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_2.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_2.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_2.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_20-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_20-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_20.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_20.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_20.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_21-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_21-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_21.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_21.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_21.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_22-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_22-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_22.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_22.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_22.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_23-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_23-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_23.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_23.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_23.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_24-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_24-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_24.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_24.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_24.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_25-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_25-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_25-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_25-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_25.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_25.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_25.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_25.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_3-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_3-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_3.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_3.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_3.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_4-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_4-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_4.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_4.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_4.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_5-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_5-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_5.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_5.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_5.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_6-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_6-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_6.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_6.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_6.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_7-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_7-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_7.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_7.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_7.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_8-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_8-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_8.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_8.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_8.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_9-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_9-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_9.ts b/es2panda/test/parser/ts/type_checker/expression/member/member_expression_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_9.ts rename to es2panda/test/parser/ts/type_checker/expression/member/member_expression_9.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_26-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_26-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_26-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_26-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_26.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_26.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_26.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_26.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_27-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_27-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_27-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_27-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_27.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_27.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_27.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_27.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_28-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_28-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_28-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_28-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_28.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_28.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_28.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_28.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_29-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_29-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_29-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_29-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_29.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_29.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_29.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_29.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_30-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_30-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_30-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_30-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_30.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_30.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_30.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_30.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_31-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_31-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_31-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_31-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_31.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_31.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_31.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_31.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_32-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_32-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_32-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_32-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_32.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_32.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_32.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_32.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_33-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_33-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_33-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_33-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_33.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_33.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_33.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_33.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_34-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_34-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_34-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_34-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_34.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_34.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_34.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_34.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_35-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_35-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_35-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_35-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_35.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_35.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_35.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_35.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_36-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_36-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_36-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_36-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_36.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_36.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_36.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_36.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_37-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_37-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_37-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_37-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_37.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_37.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_37.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_37.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_38-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_38-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_38-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_38-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_38.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_38.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_38.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_38.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_39-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_39-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_39-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_39-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_39.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_39.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_39.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_39.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_40-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_40-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_40-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_40-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_40.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_40.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_40.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_40.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_41-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_41-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_41-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_41-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_41.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_41.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_41.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_41.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_42-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_42-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_42-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_42-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_42.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_42.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_42.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_42.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_43-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_43-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_43-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_43-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_43.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_43.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_43.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_43.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_44-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_44-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_44-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_44-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_44.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_44.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_44.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_44.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_45-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_45-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_45-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_45-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_45.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_45.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_45.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_45.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_46-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_46-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_46-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_46-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_46.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_46.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_46.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_46.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_47-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_47-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_47-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_47-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_47.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_47.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_47.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_47.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_48-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_48-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_48-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_48-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_48.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_48.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_48.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_48.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_49-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_49-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_49-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_49-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_49.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_49.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_49.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_49.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_50-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_50-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_50-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_50-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_50.ts b/es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_50.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_50.ts rename to es2panda/test/parser/ts/type_checker/expression/member_2/member_expression_50.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_51-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_51-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_51-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_51-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_51.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_51.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_51.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_51.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_52-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_52-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_52-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_52-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_52.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_52.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_52.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_52.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_53-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_53-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_53-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_53-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_53.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_53.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_53.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_53.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_54-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_54-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_54-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_54-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_54.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_54.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_54.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_54.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_55-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_55-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_55-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_55-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_55.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_55.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_55.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_55.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_56-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_56-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_56-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_56-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_56.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_56.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_56.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_56.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_57-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_57-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_57-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_57-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_57.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_57.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_57.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_57.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_58-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_58-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_58-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_58-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_58.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_58.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_58.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_58.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_59-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_59-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_59-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_59-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_59.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_59.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_59.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_59.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_60-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_60-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_60-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_60-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_60.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_60.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_60.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_60.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_61-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_61-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_61-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_61-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_61.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_61.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_61.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_61.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_62-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_62-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_62-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_62-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_62.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_62.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_62.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_62.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_63-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_63-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_63-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_63-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_63.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_63.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_63.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_63.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_64-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_64-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_64-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_64-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_64.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_64.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_64.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_64.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_65-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_65-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_65-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_65-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_65.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_65.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_65.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_65.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_66-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_66-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_66-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_66-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_66.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_66.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_66.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_66.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_67-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_67-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_67-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_67-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_67.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_67.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_67.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_67.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_68-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_68-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_68-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_68-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_68.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_68.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_68.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_68.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_69-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_69-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_69-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_69-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_69.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_69.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_69.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_69.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_70-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_70-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_70-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_70-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_70.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_70.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_70.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_70.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_71-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_71-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_71-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_71-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_71.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_71.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_71.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_71.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_72-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_72-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_72-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_72-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_72.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_72.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_72.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_72.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_73-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_73-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_73-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_73-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_73.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_73.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_73.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_73.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_74-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_74-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_74-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_74-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_74.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_74.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_74.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_74.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_75-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_75-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_75-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_75-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_75.ts b/es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_75.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_75.ts rename to es2panda/test/parser/ts/type_checker/expression/member_3/member_expression_75.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_76-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_76-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_76-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_76-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_76.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_76.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_76.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_76.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_77-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_77-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_77-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_77-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_77.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_77.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_77.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_77.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_78-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_78-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_78-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_78-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_78.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_78.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_78.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_78.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_79-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_79-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_79-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_79-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_79.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_79.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_79.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_79.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_80-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_80-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_80-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_80-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_80.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_80.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_80.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_80.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_81-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_81-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_81-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_81-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_81.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_81.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_81.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_81.ts diff --git a/es2panda/test/parser/ts/type_checker/member_expression_82-expected.txt b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_82-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_82-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_82-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/member_expression_82.ts b/es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_82.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/member_expression_82.ts rename to es2panda/test/parser/ts/type_checker/expression/member_4/member_expression_82.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_1-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_1-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_1.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_1.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_1.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_10-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_10-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_10.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_10.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_10.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_11-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_11-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_11.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_11.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_11.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_12-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_12-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_12.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_12.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_12.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_13-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_13-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_13.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_13.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_13.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_14-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_14-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_14.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_14.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_14.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_15-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_15-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_15.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_15.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_15.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_16-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_16-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_16.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_16.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_16.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_17-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_17-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_17.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_17.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_17.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_18-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_18-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_18.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_18.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_18.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_19-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_19-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_19.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_19.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_19.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_2-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_2-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_2.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_2.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_2.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_20-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_20-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_20.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_20.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_20.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_21-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_21-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_21.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_21.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_21.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_22-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_22-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_22.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_22.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_22.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_23-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_23-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_23.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_23.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_23.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_24-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_24-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_24.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_24.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_24.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_25-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_25-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_25-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_25-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_25.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_25.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_25.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_25.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_3-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_3-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_3.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_3.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_3.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_4-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_4-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_4.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_4.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_4.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_5-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_5-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_5.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_5.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_5.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_6-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_6-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_6.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_6.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_6.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_7-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_7-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_7.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_7.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_7.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_8-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_8-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_8.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_8.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_8.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_9-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_9-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_9.ts b/es2panda/test/parser/ts/type_checker/expression/new/new_expression_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_9.ts rename to es2panda/test/parser/ts/type_checker/expression/new/new_expression_9.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_26-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_26-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_26-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_26-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_26.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_26.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_26.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_26.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_27-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_27-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_27-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_27-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_27.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_27.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_27.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_27.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_28-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_28-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_28-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_28-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_28.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_28.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_28.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_28.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_29-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_29-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_29-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_29-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_29.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_29.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_29.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_29.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_30-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_30-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_30-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_30-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_30.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_30.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_30.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_30.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_31-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_31-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_31-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_31-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_31.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_31.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_31.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_31.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_32-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_32-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_32-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_32-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_32.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_32.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_32.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_32.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_33-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_33-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_33-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_33-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_33.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_33.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_33.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_33.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_34-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_34-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_34-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_34-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_34.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_34.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_34.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_34.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_35-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_35-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_35-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_35-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_35.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_35.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_35.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_35.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_36-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_36-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_36-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_36-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_36.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_36.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_36.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_36.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_37-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_37-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_37-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_37-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_37.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_37.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_37.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_37.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_38-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_38-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_38-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_38-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_38.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_38.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_38.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_38.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_39-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_39-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_39-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_39-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_39.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_39.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_39.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_39.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_40-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_40-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_40-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_40-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_40.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_40.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_40.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_40.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_41-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_41-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_41-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_41-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_41.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_41.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_41.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_41.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_42-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_42-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_42-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_42-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_42.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_42.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_42.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_42.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_43-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_43-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_43-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_43-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_43.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_43.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_43.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_43.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_44-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_44-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_44-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_44-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_44.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_44.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_44.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_44.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_45-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_45-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_45-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_45-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_45.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_45.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_45.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_45.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_46-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_46-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_46-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_46-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_46.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_46.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_46.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_46.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_47-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_47-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_47-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_47-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_47.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_47.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_47.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_47.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_48-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_48-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_48-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_48-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_48.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_48.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_48.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_48.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_49-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_49-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_49-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_49-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_49.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_49.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_49.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_49.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_50-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_50-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_50-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_50-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_50.ts b/es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_50.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_50.ts rename to es2panda/test/parser/ts/type_checker/expression/new_2/new_expression_50.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_51-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_51-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_51-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_51-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_51.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_51.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_51.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_51.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_52-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_52-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_52-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_52-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_52.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_52.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_52.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_52.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_53-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_53-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_53-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_53-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_53.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_53.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_53.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_53.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_54-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_54-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_54-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_54-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_54.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_54.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_54.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_54.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_55-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_55-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_55-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_55-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_55.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_55.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_55.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_55.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_56-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_56-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_56-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_56-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_56.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_56.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_56.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_56.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_57-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_57-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_57-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_57-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_57.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_57.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_57.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_57.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_58-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_58-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_58-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_58-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_58.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_58.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_58.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_58.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_59-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_59-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_59-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_59-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_59.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_59.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_59.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_59.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_60-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_60-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_60-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_60-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_60.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_60.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_60.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_60.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_61-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_61-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_61-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_61-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_61.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_61.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_61.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_61.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_62-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_62-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_62-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_62-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_62.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_62.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_62.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_62.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_63-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_63-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_63-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_63-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_63.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_63.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_63.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_63.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_64-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_64-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_64-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_64-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_64.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_64.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_64.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_64.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_65-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_65-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_65-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_65-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_65.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_65.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_65.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_65.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_66-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_66-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_66-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_66-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_66.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_66.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_66.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_66.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_67-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_67-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_67-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_67-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_67.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_67.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_67.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_67.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_68-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_68-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_68-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_68-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_68.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_68.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_68.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_68.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_69-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_69-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_69-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_69-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_69.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_69.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_69.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_69.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_70-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_70-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_70-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_70-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_70.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_70.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_70.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_70.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_71-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_71-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_71-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_71-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_71.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_71.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_71.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_71.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_72-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_72-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_72-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_72-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_72.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_72.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_72.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_72.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_73-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_73-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_73-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_73-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_73.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_73.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_73.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_73.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_74-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_74-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_74-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_74-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_74.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_74.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_74.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_74.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_75-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_75-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_75-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_75-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_75.ts b/es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_75.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_75.ts rename to es2panda/test/parser/ts/type_checker/expression/new_3/new_expression_75.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_100-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_100-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_100-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_100-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_100.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_100.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_100.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_100.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_76-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_76-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_76-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_76-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_76.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_76.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_76.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_76.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_77-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_77-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_77-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_77-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_77.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_77.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_77.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_77.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_78-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_78-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_78-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_78-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_78.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_78.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_78.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_78.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_79-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_79-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_79-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_79-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_79.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_79.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_79.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_79.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_80-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_80-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_80-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_80-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_80.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_80.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_80.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_80.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_81-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_81-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_81-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_81-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_81.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_81.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_81.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_81.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_82-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_82-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_82-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_82-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_82.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_82.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_82.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_82.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_83-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_83-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_83-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_83-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_83.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_83.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_83.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_83.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_84-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_84-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_84-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_84-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_84.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_84.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_84.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_84.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_85-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_85-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_85-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_85-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_85.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_85.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_85.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_85.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_86-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_86-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_86-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_86-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_86.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_86.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_86.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_86.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_87-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_87-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_87-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_87-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_87.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_87.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_87.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_87.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_88-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_88-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_88-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_88-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_88.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_88.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_88.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_88.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_89-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_89-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_89-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_89-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_89.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_89.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_89.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_89.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_90-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_90-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_90-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_90-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_90.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_90.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_90.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_90.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_91-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_91-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_91-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_91-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_91.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_91.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_91.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_91.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_92-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_92-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_92-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_92-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_92.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_92.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_92.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_92.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_93-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_93-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_93-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_93-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_93.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_93.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_93.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_93.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_94-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_94-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_94-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_94-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_94.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_94.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_94.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_94.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_95-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_95-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_95-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_95-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_95.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_95.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_95.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_95.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_96-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_96-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_96-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_96-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_96.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_96.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_96.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_96.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_97-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_97-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_97-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_97-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_97.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_97.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_97.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_97.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_98-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_98-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_98-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_98-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_98.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_98.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_98.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_98.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_99-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_99-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_99-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_99-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_99.ts b/es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_99.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_99.ts rename to es2panda/test/parser/ts/type_checker/expression/new_4/new_expression_99.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_101-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_101-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_101-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_101-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_101.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_101.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_101.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_101.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_102-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_102-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_102-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_102-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_102.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_102.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_102.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_102.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_103-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_103-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_103-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_103-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_103.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_103.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_103.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_103.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_104-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_104-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_104-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_104-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_104.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_104.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_104.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_104.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_105-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_105-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_105-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_105-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_105.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_105.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_105.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_105.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_106-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_106-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_106-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_106-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_106.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_106.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_106.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_106.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_107-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_107-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_107-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_107-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_107.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_107.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_107.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_107.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_108-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_108-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_108-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_108-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_108.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_108.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_108.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_108.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_109-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_109-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_109-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_109-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_109.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_109.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_109.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_109.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_110-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_110-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_110-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_110-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_110.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_110.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_110.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_110.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_111-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_111-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_111-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_111-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_111.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_111.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_111.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_111.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_112-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_112-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_112-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_112-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_112.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_112.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_112.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_112.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_113-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_113-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_113-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_113-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_113.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_113.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_113.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_113.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_114-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_114-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_114-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_114-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_114.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_114.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_114.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_114.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_115-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_115-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_115-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_115-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_115.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_115.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_115.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_115.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_116-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_116-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_116-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_116-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_116.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_116.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_116.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_116.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_117-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_117-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_117-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_117-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_117.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_117.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_117.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_117.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_118-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_118-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_118-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_118-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_118.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_118.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_118.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_118.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_119-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_119-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_119-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_119-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_119.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_119.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_119.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_119.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_120-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_120-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_120-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_120-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_120.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_120.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_120.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_120.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_121-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_121-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_121-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_121-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_121.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_121.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_121.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_121.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_122-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_122-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_122-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_122-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_122.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_122.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_122.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_122.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_123-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_123-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_123-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_123-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_123.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_123.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_123.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_123.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_124-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_124-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_124-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_124-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_124.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_124.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_124.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_124.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_125-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_125-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_125-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_125-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_125.ts b/es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_125.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_125.ts rename to es2panda/test/parser/ts/type_checker/expression/new_5/new_expression_125.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_126-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_126-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_126-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_126-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_126.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_126.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_126.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_126.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_127-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_127-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_127-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_127-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_127.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_127.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_127.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_127.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_128-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_128-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_128-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_128-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_128.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_128.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_128.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_128.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_129-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_129-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_129-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_129-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_129.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_129.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_129.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_129.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_130-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_130-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_130-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_130-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_130.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_130.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_130.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_130.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_131-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_131-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_131-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_131-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_131.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_131.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_131.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_131.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_132-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_132-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_132-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_132-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_132.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_132.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_132.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_132.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_133-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_133-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_133-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_133-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_133.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_133.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_133.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_133.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_134-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_134-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_134-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_134-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_134.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_134.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_134.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_134.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_135-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_135-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_135-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_135-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_135.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_135.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_135.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_135.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_136-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_136-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_136-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_136-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_136.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_136.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_136.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_136.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_137-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_137-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_137-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_137-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_137.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_137.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_137.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_137.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_138-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_138-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_138-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_138-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_138.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_138.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_138.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_138.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_139-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_139-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_139-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_139-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_139.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_139.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_139.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_139.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_140-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_140-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_140-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_140-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_140.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_140.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_140.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_140.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_141-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_141-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_141-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_141-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_141.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_141.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_141.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_141.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_142-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_142-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_142-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_142-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_142.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_142.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_142.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_142.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_143-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_143-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_143-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_143-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_143.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_143.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_143.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_143.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_144-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_144-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_144-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_144-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_144.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_144.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_144.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_144.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_145-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_145-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_145-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_145-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_145.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_145.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_145.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_145.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_146-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_146-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_146-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_146-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_146.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_146.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_146.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_146.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_147-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_147-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_147-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_147-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_147.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_147.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_147.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_147.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_148-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_148-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_148-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_148-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_148.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_148.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_148.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_148.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_149-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_149-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_149-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_149-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_149.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_149.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_149.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_149.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_150-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_150-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_150-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_150-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_150.ts b/es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_150.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_150.ts rename to es2panda/test/parser/ts/type_checker/expression/new_6/new_expression_150.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_151-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_151-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_151-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_151-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_151.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_151.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_151.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_151.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_152-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_152-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_152-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_152-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_152.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_152.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_152.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_152.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_153-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_153-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_153-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_153-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_153.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_153.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_153.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_153.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_154-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_154-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_154-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_154-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_154.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_154.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_154.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_154.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_155-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_155-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_155-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_155-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_155.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_155.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_155.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_155.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_156-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_156-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_156-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_156-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_156.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_156.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_156.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_156.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_157-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_157-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_157-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_157-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_157.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_157.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_157.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_157.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_158-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_158-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_158-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_158-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_158.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_158.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_158.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_158.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_159-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_159-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_159-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_159-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_159.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_159.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_159.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_159.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_160-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_160-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_160-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_160-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_160.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_160.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_160.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_160.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_161-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_161-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_161-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_161-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_161.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_161.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_161.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_161.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_162-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_162-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_162-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_162-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_162.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_162.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_162.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_162.ts diff --git a/es2panda/test/parser/ts/type_checker/new_expression_163-expected.txt b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_163-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_163-expected.txt rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_163-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/new_expression_163.ts b/es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_163.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/new_expression_163.ts rename to es2panda/test/parser/ts/type_checker/expression/new_7/new_expression_163.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_1-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_1-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_1.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_1.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_1.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_10-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_10-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_10.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_10.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_10.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_11-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_11-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_11.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_11.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_11.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_2-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_2-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_2.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_2.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_2.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_3-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_3-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_3.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_3.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_3.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_4-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_4-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_4.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_4.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_4.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_5-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_5-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_5.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_5.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_5.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_6-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_6-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_6.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_6.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_6.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_7-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_7-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_7.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_7.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_7.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_8-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_8-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_8.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_8.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_8.ts diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_9-expected.txt b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_9-expected.txt rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/function_declaration_9.ts b/es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/function_declaration_9.ts rename to es2panda/test/parser/ts/type_checker/function/declaration/function_declaration_9.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_1-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_1-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_1.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_1.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_1.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_10-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_10-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_10.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_10.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_10.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_11-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_11-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_11.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_11.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_11.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_12-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_12-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_12.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_12.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_12.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_13-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_13-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_13.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_13.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_13.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_14-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_14-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_14.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_14.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_14.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_15-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_15-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_15.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_15.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_15.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_2-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_2-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_2.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_2.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_2.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_3-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_3-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_3.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_3.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_3.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_4-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_4-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_4.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_4.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_4.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_5-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_5-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_5.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_5.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_5.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_6-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_6-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_6.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_6.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_6.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_7-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_7-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_7.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_7.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_7.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_8-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_8-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_8.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_8.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_8.ts diff --git a/es2panda/test/parser/ts/type_checker/functionCall_9-expected.txt b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_9-expected.txt rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionCall_9.ts b/es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionCall_9.ts rename to es2panda/test/parser/ts/type_checker/function/functionCall/functionCall_9.ts diff --git a/es2panda/test/parser/ts/type_checker/functionOverload1-expected.txt b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload1-expected.txt rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionOverload1.ts b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload1.ts rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload1.ts diff --git a/es2panda/test/parser/ts/type_checker/functionOverload2-expected.txt b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload2-expected.txt rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionOverload2.ts b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload2.ts rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload2.ts diff --git a/es2panda/test/parser/ts/type_checker/functionOverload3-expected.txt b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload3-expected.txt rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionOverload3.ts b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload3.ts rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload3.ts diff --git a/es2panda/test/parser/ts/type_checker/functionOverload4-expected.txt b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload4-expected.txt rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionOverload4.ts b/es2panda/test/parser/ts/type_checker/function/overload/functionOverload4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionOverload4.ts rename to es2panda/test/parser/ts/type_checker/function/overload/functionOverload4.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern1-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern1-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern1.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern1.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern1.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern10-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern10-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern10.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern10.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern10.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern11-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern11-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern11.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern11.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern11.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern12-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern12-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern12.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern12.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern12.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern2-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern2-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern2.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern2.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern2.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern3-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern3-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern3.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern3.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern3.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern4-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern4-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern4.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern4.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern4.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern5-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern5-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern5.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern5.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern5.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern6-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern6-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern6.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern6.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern6.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern7-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern7-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern7.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern7.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern7.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern8-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern8-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern8.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern8.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern8.ts diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern9-expected.txt b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern9-expected.txt rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/functionWithPattern9.ts b/es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/functionWithPattern9.ts rename to es2panda/test/parser/ts/type_checker/function/withPattern/functionWithPattern9.ts diff --git a/es2panda/test/parser/ts/type_checker/in_1-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_1-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_1.ts b/es2panda/test/parser/ts/type_checker/in/in_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_1.ts rename to es2panda/test/parser/ts/type_checker/in/in_1.ts diff --git a/es2panda/test/parser/ts/type_checker/in_10-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_10-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_10.ts b/es2panda/test/parser/ts/type_checker/in/in_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_10.ts rename to es2panda/test/parser/ts/type_checker/in/in_10.ts diff --git a/es2panda/test/parser/ts/type_checker/in_11-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_11-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_11.ts b/es2panda/test/parser/ts/type_checker/in/in_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_11.ts rename to es2panda/test/parser/ts/type_checker/in/in_11.ts diff --git a/es2panda/test/parser/ts/type_checker/in_12-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_12-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_12.ts b/es2panda/test/parser/ts/type_checker/in/in_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_12.ts rename to es2panda/test/parser/ts/type_checker/in/in_12.ts diff --git a/es2panda/test/parser/ts/type_checker/in_13-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_13-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_13.ts b/es2panda/test/parser/ts/type_checker/in/in_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_13.ts rename to es2panda/test/parser/ts/type_checker/in/in_13.ts diff --git a/es2panda/test/parser/ts/type_checker/in_14-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_14-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_14.ts b/es2panda/test/parser/ts/type_checker/in/in_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_14.ts rename to es2panda/test/parser/ts/type_checker/in/in_14.ts diff --git a/es2panda/test/parser/ts/type_checker/in_15-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_15-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_15.ts b/es2panda/test/parser/ts/type_checker/in/in_15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_15.ts rename to es2panda/test/parser/ts/type_checker/in/in_15.ts diff --git a/es2panda/test/parser/ts/type_checker/in_2-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_2-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_2.ts b/es2panda/test/parser/ts/type_checker/in/in_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_2.ts rename to es2panda/test/parser/ts/type_checker/in/in_2.ts diff --git a/es2panda/test/parser/ts/type_checker/in_3-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_3-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_3.ts b/es2panda/test/parser/ts/type_checker/in/in_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_3.ts rename to es2panda/test/parser/ts/type_checker/in/in_3.ts diff --git a/es2panda/test/parser/ts/type_checker/in_4-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_4-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_4.ts b/es2panda/test/parser/ts/type_checker/in/in_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_4.ts rename to es2panda/test/parser/ts/type_checker/in/in_4.ts diff --git a/es2panda/test/parser/ts/type_checker/in_5-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_5-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_5.ts b/es2panda/test/parser/ts/type_checker/in/in_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_5.ts rename to es2panda/test/parser/ts/type_checker/in/in_5.ts diff --git a/es2panda/test/parser/ts/type_checker/in_6-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_6-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_6.ts b/es2panda/test/parser/ts/type_checker/in/in_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_6.ts rename to es2panda/test/parser/ts/type_checker/in/in_6.ts diff --git a/es2panda/test/parser/ts/type_checker/in_7-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_7-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_7.ts b/es2panda/test/parser/ts/type_checker/in/in_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_7.ts rename to es2panda/test/parser/ts/type_checker/in/in_7.ts diff --git a/es2panda/test/parser/ts/type_checker/in_8-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_8-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_8.ts b/es2panda/test/parser/ts/type_checker/in/in_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_8.ts rename to es2panda/test/parser/ts/type_checker/in/in_8.ts diff --git a/es2panda/test/parser/ts/type_checker/in_9-expected.txt b/es2panda/test/parser/ts/type_checker/in/in_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_9-expected.txt rename to es2panda/test/parser/ts/type_checker/in/in_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/in_9.ts b/es2panda/test/parser/ts/type_checker/in/in_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/in_9.ts rename to es2panda/test/parser/ts/type_checker/in/in_9.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_1-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_1-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_1.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_1.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_1.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_10-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_10-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_10.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_10.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_10.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_11-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_11-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_11.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_11.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_11.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_12-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_12-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_12.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_12.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_12.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_13-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_13-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_13.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_13.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_13.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_14-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_14-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_14.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_14.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_14.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_2-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_2-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_2.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_2.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_2.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_3-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_3-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_3.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_3.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_3.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_4-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_4-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_4.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_4.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_4.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_5-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_5-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_5.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_5.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_5.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_6-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_6-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_6.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_6.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_6.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_7-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_7-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_7.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_7.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_7.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_8-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_8-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_8.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_8.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_8.ts diff --git a/es2panda/test/parser/ts/type_checker/instanceof_9-expected.txt b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_9-expected.txt rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/instanceof_9.ts b/es2panda/test/parser/ts/type_checker/instanceof/instanceof_9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/instanceof_9.ts rename to es2panda/test/parser/ts/type_checker/instanceof/instanceof_9.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment1-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment1-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment1.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment1.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment1.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment2-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment2-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment2.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment2.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment2.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment3-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment3-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment3.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment3.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment3.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment4-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment4-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment4.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment4.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment4.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment5-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment5-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment5.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment5.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment5.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment6-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment6-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment6.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment6.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment6.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment7-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment7-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment7.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment7.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment7.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment8-expected.txt b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment8-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceAssignment8.ts b/es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceAssignment8.ts rename to es2panda/test/parser/ts/type_checker/interface/assignment/interfaceAssignment8.ts diff --git a/es2panda/test/parser/ts/type_checker/interface_enum_member-expected.txt b/es2panda/test/parser/ts/type_checker/interface/enum/interface_enum_member-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interface_enum_member-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/enum/interface_enum_member-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interface_enum_member.ts b/es2panda/test/parser/ts/type_checker/interface/enum/interface_enum_member.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interface_enum_member.ts rename to es2panda/test/parser/ts/type_checker/interface/enum/interface_enum_member.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance1-expected.txt b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance1-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance1.ts b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance1.ts rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance1.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance2-expected.txt b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance2-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance2.ts b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance2.ts rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance2.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance3-expected.txt b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance3-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance3.ts b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance3.ts rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance3.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance4-expected.txt b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance4-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceInheritance4.ts b/es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceInheritance4.ts rename to es2panda/test/parser/ts/type_checker/interface/inheritance/interfaceInheritance4.ts diff --git a/es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface-expected.txt b/es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface.ts b/es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface.ts rename to es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface.ts diff --git a/es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface1-expected.txt b/es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface1-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface1.ts b/es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfacePropertyReferenceContainingInterface1.ts rename to es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyReferenceContainingInterface1.ts diff --git a/es2panda/test/parser/ts/type_checker/interfacePropertyWithIncompatibleIndexInfo-expected.txt b/es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyWithIncompatibleIndexInfo-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfacePropertyWithIncompatibleIndexInfo-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyWithIncompatibleIndexInfo-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfacePropertyWithIncompatibleIndexInfo.ts b/es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyWithIncompatibleIndexInfo.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfacePropertyWithIncompatibleIndexInfo.ts rename to es2panda/test/parser/ts/type_checker/interface/propertyReferenceContainingInterface/interfacePropertyWithIncompatibleIndexInfo.ts diff --git a/es2panda/test/parser/ts/type_checker/test-interface-expected.txt b/es2panda/test/parser/ts/type_checker/interface/test-interface-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/test-interface-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-interface.ts b/es2panda/test/parser/ts/type_checker/interface/test-interface.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface.ts rename to es2panda/test/parser/ts/type_checker/interface/test-interface.ts diff --git a/es2panda/test/parser/ts/type_checker/test-interface4-expected.txt b/es2panda/test/parser/ts/type_checker/interface/test-interface4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface4-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/test-interface4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-interface4.ts b/es2panda/test/parser/ts/type_checker/interface/test-interface4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface4.ts rename to es2panda/test/parser/ts/type_checker/interface/test-interface4.ts diff --git a/es2panda/test/parser/ts/type_checker/test-interface5-expected.txt b/es2panda/test/parser/ts/type_checker/interface/test-interface5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface5-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/test-interface5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-interface5.ts b/es2panda/test/parser/ts/type_checker/interface/test-interface5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface5.ts rename to es2panda/test/parser/ts/type_checker/interface/test-interface5.ts diff --git a/es2panda/test/parser/ts/type_checker/test-interface6-expected.txt b/es2panda/test/parser/ts/type_checker/interface/test-interface6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface6-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/test-interface6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-interface6.ts b/es2panda/test/parser/ts/type_checker/interface/test-interface6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface6.ts rename to es2panda/test/parser/ts/type_checker/interface/test-interface6.ts diff --git a/es2panda/test/parser/ts/type_checker/test-interface7-expected.txt b/es2panda/test/parser/ts/type_checker/interface/test-interface7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface7-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/test-interface7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-interface7.ts b/es2panda/test/parser/ts/type_checker/interface/test-interface7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-interface7.ts rename to es2panda/test/parser/ts/type_checker/interface/test-interface7.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceUsedAsValue-expected.txt b/es2panda/test/parser/ts/type_checker/interface/usedAsValue/interfaceUsedAsValue-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceUsedAsValue-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/usedAsValue/interfaceUsedAsValue-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceUsedAsValue.ts b/es2panda/test/parser/ts/type_checker/interface/usedAsValue/interfaceUsedAsValue.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceUsedAsValue.ts rename to es2panda/test/parser/ts/type_checker/interface/usedAsValue/interfaceUsedAsValue.ts diff --git a/es2panda/test/parser/ts/type_checker/interfaceWithNonCompatibleIndexInfos-expected.txt b/es2panda/test/parser/ts/type_checker/interface/withNonCompatibleIndexInfos/interfaceWithNonCompatibleIndexInfos-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceWithNonCompatibleIndexInfos-expected.txt rename to es2panda/test/parser/ts/type_checker/interface/withNonCompatibleIndexInfos/interfaceWithNonCompatibleIndexInfos-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/interfaceWithNonCompatibleIndexInfos.ts b/es2panda/test/parser/ts/type_checker/interface/withNonCompatibleIndexInfos/interfaceWithNonCompatibleIndexInfos.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/interfaceWithNonCompatibleIndexInfos.ts rename to es2panda/test/parser/ts/type_checker/interface/withNonCompatibleIndexInfos/interfaceWithNonCompatibleIndexInfos.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_1-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_1-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_1.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_1.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_1.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_2-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_2-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_2.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_2.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_2.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_3-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_3-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_3.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_3.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_3.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_4-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_4-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_4.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_4.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_4.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_5-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_5-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_5.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_5.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_5.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_6-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_6-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTest_6.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTest_6.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTest_6.ts diff --git a/es2panda/test/parser/ts/type_checker/memberExpTests-expected.txt b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTests-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTests-expected.txt rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTests-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/memberExpTests.ts b/es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTests.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/memberExpTests.ts rename to es2panda/test/parser/ts/type_checker/memberExpTest/memberExpTests.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring1-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring1-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring1.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring1.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring1.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring10-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring10-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring10.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring10.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring10.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring11-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring11-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring11.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring11.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring11.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring12-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring12-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring12.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring12.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring12.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring13-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring13-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring13.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring13.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring13.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring14-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring14-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring14.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring14.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring14.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring15-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring15-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring15.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring15.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring15.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring16-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring16-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring16.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring16.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring16.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring17-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring17-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring17.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring17.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring17.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring18-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring18-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring18.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring18.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring18.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring19-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring19-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring19.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring19.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring19.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring2-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring2-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring2.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring2.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring2.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring20-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring20-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring20.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring20.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring20.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring21-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring21-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring21.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring21.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring21.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring22-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring22-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring22.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring22.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring22.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring23-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring23-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring23.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring23.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring23.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring24-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring24-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring24.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring24.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring24.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring3-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring3-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring3.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring3.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring3.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring4-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring4-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring4.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring4.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring4.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring5-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring5-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring5.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring5.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring5.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring6-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring6-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring6.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring6.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring6.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring7-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring7-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring7.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring7.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring7.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring8-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring8-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring8.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring8.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring8.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring9-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring9-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring9.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring9.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing/objectDestructuring9.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring25-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring25-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring25-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring25-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring25.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring25.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring25.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring25.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring26-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring26-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring26-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring26-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring26.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring26.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring26.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring26.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring27-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring27-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring27-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring27-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring27.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring27.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring27.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring27.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring28-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring28-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring28-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring28-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring28.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring28.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring28.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring28.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring29-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring29-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring29-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring29-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring29.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring29.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring29.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring29.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring30-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring30-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring30-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring30-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring30.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring30.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring30.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring30.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring31-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring31-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring31-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring31-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring31.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring31.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring31.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring31.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring32-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring32-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring32-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring32-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring32.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring32.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring32.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring32.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring33-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring33-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring33-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring33-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring33.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring33.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring33.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring33.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring34-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring34-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring34-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring34-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring34.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring34.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring34.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring34.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring35-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring35-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring35-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring35-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring35.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring35.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring35.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring35.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring36-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring36-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring36-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring36-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring36.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring36.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring36.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring36.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring37-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring37-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring37-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring37-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring37.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring37.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring37.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring37.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring38-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring38-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring38-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring38-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring38.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring38.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring38.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring38.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring39-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring39-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring39-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring39-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring39.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring39.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring39.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring39.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring40-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring40-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring40-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring40-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring40.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring40.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring40.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring40.ts diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring41-expected.txt b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring41-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring41-expected.txt rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring41-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectDestructuring41.ts b/es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring41.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectDestructuring41.ts rename to es2panda/test/parser/ts/type_checker/objectDestrycturing_2/objectDestructuring41.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability1-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability1-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability1.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability1.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability1.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability10-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability10-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability10.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability10.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability10.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability11-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability11-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability11.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability11.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability11.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability12-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability12-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability12.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability12.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability12.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability13-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability13-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability13.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability13.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability13.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability14-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability14-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability14.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability14.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability14.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability15-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability15-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability15.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability15.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability15.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability16-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability16-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability16.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability16.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability16.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability17-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability17-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability17.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability17.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability17.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability18-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability18-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability18.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability18.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability18.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability19-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability19-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability19.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability19.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability19.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability2-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability2-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability2.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability2.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability2.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability20-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability20-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability20.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability20.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability20.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability3-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability3-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability3.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability3.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability3.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability4-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability4-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability4.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability4.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability4.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability5-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability5-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability5.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability5.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability5.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability6-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability6-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability6.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability6.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability6.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability7-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability7-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability7.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability7.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability7.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability8-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability8-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability8.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability8.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability8.ts diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability9-expected.txt b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability9-expected.txt rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/objectLiteralAssignability9.ts b/es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/objectLiteralAssignability9.ts rename to es2panda/test/parser/ts/type_checker/objectLiteralAssugnability/objectLiteralAssignability9.ts diff --git a/es2panda/test/parser/ts/type_checker/constUsedBeforeDeclaration-expected.txt b/es2panda/test/parser/ts/type_checker/others/constUsedBeforeDeclaration-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/constUsedBeforeDeclaration-expected.txt rename to es2panda/test/parser/ts/type_checker/others/constUsedBeforeDeclaration-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/constUsedBeforeDeclaration.ts b/es2panda/test/parser/ts/type_checker/others/constUsedBeforeDeclaration.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/constUsedBeforeDeclaration.ts rename to es2panda/test/parser/ts/type_checker/others/constUsedBeforeDeclaration.ts diff --git a/es2panda/test/parser/ts/type_checker/identifierWithoutDeclaration-expected.txt b/es2panda/test/parser/ts/type_checker/others/identifierWithoutDeclaration-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/identifierWithoutDeclaration-expected.txt rename to es2panda/test/parser/ts/type_checker/others/identifierWithoutDeclaration-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/identifierWithoutDeclaration.ts b/es2panda/test/parser/ts/type_checker/others/identifierWithoutDeclaration.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/identifierWithoutDeclaration.ts rename to es2panda/test/parser/ts/type_checker/others/identifierWithoutDeclaration.ts diff --git a/es2panda/test/parser/ts/type_checker/letUsedBeforeDeclaration-expected.txt b/es2panda/test/parser/ts/type_checker/others/letUsedBeforeDeclaration-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/letUsedBeforeDeclaration-expected.txt rename to es2panda/test/parser/ts/type_checker/others/letUsedBeforeDeclaration-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/letUsedBeforeDeclaration.ts b/es2panda/test/parser/ts/type_checker/others/letUsedBeforeDeclaration.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/letUsedBeforeDeclaration.ts rename to es2panda/test/parser/ts/type_checker/others/letUsedBeforeDeclaration.ts diff --git a/es2panda/test/parser/ts/type_checker/recursiveFunction-expected.txt b/es2panda/test/parser/ts/type_checker/others/recursiveFunction-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/recursiveFunction-expected.txt rename to es2panda/test/parser/ts/type_checker/others/recursiveFunction-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/recursiveFunction.ts b/es2panda/test/parser/ts/type_checker/others/recursiveFunction.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/recursiveFunction.ts rename to es2panda/test/parser/ts/type_checker/others/recursiveFunction.ts diff --git a/es2panda/test/parser/ts/type_checker/recursiveTypeofWithProperty-expected.txt b/es2panda/test/parser/ts/type_checker/others/recursiveTypeofWithProperty-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/recursiveTypeofWithProperty-expected.txt rename to es2panda/test/parser/ts/type_checker/others/recursiveTypeofWithProperty-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/recursiveTypeofWithProperty.ts b/es2panda/test/parser/ts/type_checker/others/recursiveTypeofWithProperty.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/recursiveTypeofWithProperty.ts rename to es2panda/test/parser/ts/type_checker/others/recursiveTypeofWithProperty.ts diff --git a/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt b/es2panda/test/parser/ts/type_checker/others/typeAliasUsedAsValue-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt rename to es2panda/test/parser/ts/type_checker/others/typeAliasUsedAsValue-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue.ts b/es2panda/test/parser/ts/type_checker/others/typeAliasUsedAsValue.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue.ts rename to es2panda/test/parser/ts/type_checker/others/typeAliasUsedAsValue.ts diff --git a/es2panda/test/parser/ts/type_checker/undefined_as_value-expected.txt b/es2panda/test/parser/ts/type_checker/others/undefined_as_value-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/undefined_as_value-expected.txt rename to es2panda/test/parser/ts/type_checker/others/undefined_as_value-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/undefined_as_value.ts b/es2panda/test/parser/ts/type_checker/others/undefined_as_value.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/undefined_as_value.ts rename to es2panda/test/parser/ts/type_checker/others/undefined_as_value.ts diff --git a/es2panda/test/parser/ts/type_checker/undefined_variable_name-expected.txt b/es2panda/test/parser/ts/type_checker/others/undefined_variable_name-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/undefined_variable_name-expected.txt rename to es2panda/test/parser/ts/type_checker/others/undefined_variable_name-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/undefined_variable_name.ts b/es2panda/test/parser/ts/type_checker/others/undefined_variable_name.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/undefined_variable_name.ts rename to es2panda/test/parser/ts/type_checker/others/undefined_variable_name.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability1-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability1-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability1.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability1.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability1.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability10-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability10-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability10.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability10.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability10.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability11-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability11-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability11.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability11.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability11.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability12-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability12-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability12.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability12.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability12.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability13-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability13-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability13.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability13.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability13.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability14-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability14-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability14.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability14.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability14.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability15-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability15-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability15.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability15.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability15.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability16-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability16-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability16-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability16-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability16.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability16.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability16.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability16.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability17-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability17-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability17-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability17-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability17.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability17.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability17.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability17.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability18-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability18-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability18-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability18-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability18.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability18.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability18.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability18.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability19-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability19-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability19-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability19-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability19.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability19.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability19.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability19.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability2-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability2-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability2.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability2.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability2.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability20-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability20-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability20-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability20-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability20.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability20.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability20.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability20.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability21-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability21-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability21-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability21-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability21.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability21.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability21.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability21.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability22-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability22-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability22-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability22-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability22.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability22.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability22.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability22.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability23-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability23-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability23-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability23-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability23.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability23.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability23.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability23.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability24-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability24-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability24-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability24-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability24.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability24.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability24.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability24.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability3-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability3-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability3.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability3.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability3.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability4-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability4-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability4.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability4.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability4.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability5-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability5-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability5.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability5.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability5.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability6-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability6-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability6.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability6.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability6.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability7-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability7-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability7.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability7.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability7.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability8-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability8-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability8.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability8.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability8.ts diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability9-expected.txt b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability9-expected.txt rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/tupleAssignability9.ts b/es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/tupleAssignability9.ts rename to es2panda/test/parser/ts/type_checker/tupleAssignability/tupleAssignability9.ts diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal-expected.txt b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal-expected.txt rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal.ts b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal.ts rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal.ts diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal4-expected.txt b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal4-expected.txt rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal4.ts b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal4.ts rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal4.ts diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal5-expected.txt b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal5-expected.txt rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal5.ts b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal5.ts rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal5.ts diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal6-expected.txt b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal6-expected.txt rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal6.ts b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal6.ts rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal6.ts diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal7-expected.txt b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal7-expected.txt rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/test-type-literal7.ts b/es2panda/test/parser/ts/type_checker/type-liter/test-type-literal7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/test-type-literal7.ts rename to es2panda/test/parser/ts/type_checker/type-liter/test-type-literal7.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration1-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration1-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration1-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration1-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration1.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration1.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration1.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration1.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration10-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration10-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration10-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration10-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration10.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration10.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration10.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration10.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration11-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration11-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration11-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration11-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration11.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration11.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration11.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration11.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration12-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration12-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration12-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration12-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration12.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration12.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration12.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration12.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration13-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration13-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration13-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration13-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration13.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration13.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration13.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration13.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration14-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration14-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration14-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration14-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration14.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration14.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration14.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration14.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration15-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration15-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration15-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration15-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration15.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration15.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration15.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration15.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration2-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration2-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration2-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration2-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration2.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration2.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration2.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration2.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration3-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration3-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration3-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration3-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration3.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration3.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration3.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration3.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration4-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration4-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration4-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration4-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration4.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration4.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration4.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration4.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration5-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration5-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration5-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration5-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration5.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration5.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration5.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration5.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration6-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration6-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration6-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration6-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration6.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration6.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration6.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration6.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration7-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration7-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration7-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration7-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration7.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration7.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration7.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration7.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration8-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration8-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration8-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration8-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration8.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration8.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration8.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration8.ts diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration9-expected.txt b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration9-expected.txt similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration9-expected.txt rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration9-expected.txt diff --git a/es2panda/test/parser/ts/type_checker/varRedeclaration9.ts b/es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration9.ts similarity index 100% rename from es2panda/test/parser/ts/type_checker/varRedeclaration9.ts rename to es2panda/test/parser/ts/type_checker/varRedeclaration/varRedeclaration9.ts