From 07c19787ab67e9362ebe3d86f574849bcf4f41ec Mon Sep 17 00:00:00 2001 From: shawn_hu_ls Date: Sat, 3 Dec 2022 21:06:43 +0800 Subject: [PATCH] Remove redundant EmptyStatement after TSTypeAliasDeclaration Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I64GTN?from=project-issue Tests: test262 / es2abc_tests Signed-off-by: shawn_hu_ls --- es2panda/parser/statementParser.cpp | 1 + ...est-ts-type-alias-declaration-expected.txt | 96 +++++++++++ .../test-ts-type-alias-declaration.d.ts | 18 +++ ...st-ts-type-alias-declaration1-expected.txt | 1 + .../test-ts-type-alias-declaration1.d.ts | 18 +++ .../parser/ts/test-export-type-expected.txt | 26 --- .../parser/ts/test-intersection-expected.txt | 130 --------------- .../ts/test-keyword-declare-expected.txt | 26 --- .../ts/test-keyword-identify6-expected.txt | 13 -- .../ts/test-ts-conditional-type-expected.txt | 26 --- .../ts/test-ts-mapped-type-expected.txt | 91 ----------- ...est-ts-type-alias-declaration-expected.txt | 150 ++++++++++++++++++ .../ts/test-ts-type-alias-declaration.ts | 19 +++ .../ts/test-ts-type-predicate-expected.txt | 13 -- .../parser/ts/test-tuple-type6-expected.txt | 13 -- .../parser/ts/test-type-alias-expected.txt | 39 ----- .../test-type-template-literal1-expected.txt | 26 --- .../test-type-template-literal2-expected.txt | 52 ------ .../test-type-template-literal3-expected.txt | 52 ------ .../test/parser/ts/test_generic-expected.txt | 39 ----- .../typeAliasUsedAsValue-expected.txt | 13 -- 21 files changed, 303 insertions(+), 559 deletions(-) create mode 100644 es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration-expected.txt create mode 100644 es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration.d.ts create mode 100644 es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1-expected.txt create mode 100644 es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1.d.ts create mode 100644 es2panda/test/parser/ts/test-ts-type-alias-declaration-expected.txt create mode 100644 es2panda/test/parser/ts/test-ts-type-alias-declaration.ts diff --git a/es2panda/parser/statementParser.cpp b/es2panda/parser/statementParser.cpp index bee0d92d6d..b91c02a0ba 100644 --- a/es2panda/parser/statementParser.cpp +++ b/es2panda/parser/statementParser.cpp @@ -715,6 +715,7 @@ ir::TSTypeAliasDeclaration *ParserImpl::ParseTsTypeAliasDeclaration(bool isDecla auto *typeAliasDecl = AllocNode(id, typeParamDecl, typeAnnotation, isDeclare); typeAliasDecl->SetRange({typeStart, lexer_->GetToken().End()}); decl->BindNode(typeAliasDecl); + ConsumeSemicolon(typeAliasDecl); return typeAliasDecl; } diff --git a/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration-expected.txt b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration-expected.txt new file mode 100644 index 0000000000..d749a6c667 --- /dev/null +++ b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration-expected.txt @@ -0,0 +1,96 @@ +{ + "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 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 18, + "column": 25 + } + } +} diff --git a/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration.d.ts b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration.d.ts new file mode 100644 index 0000000000..983ef932b3 --- /dev/null +++ b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration.d.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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; \ No newline at end of file diff --git a/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1-expected.txt b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1-expected.txt new file mode 100644 index 0000000000..4923364255 --- /dev/null +++ b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Statements are not allowed in ambient contexts. [test-ts-type-alias-declaration1.d.ts:18:26] diff --git a/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1.d.ts b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1.d.ts new file mode 100644 index 0000000000..5447d9fa1a --- /dev/null +++ b/es2panda/test/parser/ts/cases/declaration/test-ts-type-alias-declaration1.d.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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;; \ No newline at end of file diff --git a/es2panda/test/parser/ts/test-export-type-expected.txt b/es2panda/test/parser/ts/test-export-type-expected.txt index 3028aac6d4..a98e53fa1f 100644 --- a/es2panda/test/parser/ts/test-export-type-expected.txt +++ b/es2panda/test/parser/ts/test-export-type-expected.txt @@ -56,19 +56,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -109,19 +96,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, { "type": "ExportNamedDeclaration", "declaration": null, diff --git a/es2panda/test/parser/ts/test-intersection-expected.txt b/es2panda/test/parser/ts/test-intersection-expected.txt index b54ec92e7a..48c78d1129 100644 --- a/es2panda/test/parser/ts/test-intersection-expected.txt +++ b/es2panda/test/parser/ts/test-intersection-expected.txt @@ -41,19 +41,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -94,19 +81,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 17 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -147,19 +121,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 16 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -200,19 +161,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 17 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -253,19 +201,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -306,19 +241,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 22, - "column": 16 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -555,19 +477,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 24, - "column": 35 - }, - "end": { - "line": 24, - "column": 36 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -1176,19 +1085,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 26, - "column": 43 - }, - "end": { - "line": 26, - "column": 44 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -1367,19 +1263,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 27, - "column": 29 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -1670,19 +1553,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 28, - "column": 39 - }, - "end": { - "line": 28, - "column": 40 - } - } - }, { "type": "VariableDeclaration", "declarations": [ diff --git a/es2panda/test/parser/ts/test-keyword-declare-expected.txt b/es2panda/test/parser/ts/test-keyword-declare-expected.txt index 4e2c49ba6a..ca36f639e2 100644 --- a/es2panda/test/parser/ts/test-keyword-declare-expected.txt +++ b/es2panda/test/parser/ts/test-keyword-declare-expected.txt @@ -407,19 +407,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 27, - "column": 29 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -489,19 +476,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 28, - "column": 37 - }, - "end": { - "line": 28, - "column": 38 - } - } - }, { "type": "FunctionDeclaration", "function": { diff --git a/es2panda/test/parser/ts/test-keyword-identify6-expected.txt b/es2panda/test/parser/ts/test-keyword-identify6-expected.txt index e1cb1cd00d..35147d0c27 100644 --- a/es2panda/test/parser/ts/test-keyword-identify6-expected.txt +++ b/es2panda/test/parser/ts/test-keyword-identify6-expected.txt @@ -236,19 +236,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, { "type": "ExpressionStatement", "expression": { diff --git a/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt b/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt index 9c8700cb0f..78b3b9e3c4 100644 --- a/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt +++ b/es2panda/test/parser/ts/test-ts-conditional-type-expected.txt @@ -499,19 +499,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 200 - }, - "end": { - "line": 18, - "column": 201 - } - } - }, { "type": "VariableDeclaration", "declarations": [ @@ -1710,19 +1697,6 @@ "column": 9 } } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 31, - "column": 9 - } - } } ], "loc": { diff --git a/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt b/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt index 98d3821f03..988ddcf651 100644 --- a/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt +++ b/es2panda/test/parser/ts/test-ts-mapped-type-expected.txt @@ -166,19 +166,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 62 - }, - "end": { - "line": 17, - "column": 63 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -344,19 +331,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 62 - }, - "end": { - "line": 18, - "column": 63 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -522,19 +496,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 60 - }, - "end": { - "line": 19, - "column": 61 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -698,19 +659,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 20, - "column": 50 - }, - "end": { - "line": 20, - "column": 51 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -874,19 +822,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 21, - "column": 49 - }, - "end": { - "line": 21, - "column": 50 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -1037,19 +972,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 22, - "column": 41 - }, - "end": { - "line": 22, - "column": 42 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -1199,19 +1121,6 @@ "column": 41 } } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 23, - "column": 40 - }, - "end": { - "line": 23, - "column": 41 - } - } } ], "loc": { 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 new file mode 100644 index 0000000000..906377f47c --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-type-alias-declaration-expected.txt @@ -0,0 +1,150 @@ +{ + "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 new file mode 100644 index 0000000000..2477448b6b --- /dev/null +++ b/es2panda/test/parser/ts/test-ts-type-alias-declaration.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-predicate-expected.txt b/es2panda/test/parser/ts/test-ts-type-predicate-expected.txt index 227136251b..cbdf350db9 100644 --- a/es2panda/test/parser/ts/test-ts-type-predicate-expected.txt +++ b/es2panda/test/parser/ts/test-ts-type-predicate-expected.txt @@ -4091,19 +4091,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 64, - "column": 36 - }, - "end": { - "line": 64, - "column": 37 - } - } - }, { "type": "FunctionDeclaration", "function": { diff --git a/es2panda/test/parser/ts/test-tuple-type6-expected.txt b/es2panda/test/parser/ts/test-tuple-type6-expected.txt index 2aabb2bb32..bb95e522b6 100644 --- a/es2panda/test/parser/ts/test-tuple-type6-expected.txt +++ b/es2panda/test/parser/ts/test-tuple-type6-expected.txt @@ -177,19 +177,6 @@ "column": 75 } } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 74 - }, - "end": { - "line": 17, - "column": 75 - } - } } ], "loc": { diff --git a/es2panda/test/parser/ts/test-type-alias-expected.txt b/es2panda/test/parser/ts/test-type-alias-expected.txt index a0caa692e0..feb584db18 100644 --- a/es2panda/test/parser/ts/test-type-alias-expected.txt +++ b/es2panda/test/parser/ts/test-type-alias-expected.txt @@ -69,19 +69,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -246,19 +233,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 50 - }, - "end": { - "line": 18, - "column": 51 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -394,19 +368,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 34 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, { "type": "VariableDeclaration", "declarations": [ diff --git a/es2panda/test/parser/ts/test-type-template-literal1-expected.txt b/es2panda/test/parser/ts/test-type-template-literal1-expected.txt index f397c533bd..6892189ab0 100644 --- a/es2panda/test/parser/ts/test-type-template-literal1-expected.txt +++ b/es2panda/test/parser/ts/test-type-template-literal1-expected.txt @@ -55,19 +55,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -172,19 +159,6 @@ "column": 37 } } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 36 - }, - "end": { - "line": 18, - "column": 37 - } - } } ], "loc": { diff --git a/es2panda/test/parser/ts/test-type-template-literal2-expected.txt b/es2panda/test/parser/ts/test-type-template-literal2-expected.txt index 2396614cd1..ed5e75b29c 100644 --- a/es2panda/test/parser/ts/test-type-template-literal2-expected.txt +++ b/es2panda/test/parser/ts/test-type-template-literal2-expected.txt @@ -97,19 +97,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -206,19 +193,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -315,19 +289,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -518,19 +479,6 @@ "column": 39 } } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 39 - } - } } ], "loc": { diff --git a/es2panda/test/parser/ts/test-type-template-literal3-expected.txt b/es2panda/test/parser/ts/test-type-template-literal3-expected.txt index 0b54b489de..6b7d1c40b1 100644 --- a/es2panda/test/parser/ts/test-type-template-literal3-expected.txt +++ b/es2panda/test/parser/ts/test-type-template-literal3-expected.txt @@ -203,19 +203,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 16, - "column": 69 - }, - "end": { - "line": 16, - "column": 70 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -418,19 +405,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 69 - }, - "end": { - "line": 17, - "column": 70 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -527,19 +501,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -635,19 +596,6 @@ "column": 34 } } - }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 34 - } - } } ], "loc": { diff --git a/es2panda/test/parser/ts/test_generic-expected.txt b/es2panda/test/parser/ts/test_generic-expected.txt index 93c4200150..679b55c28c 100644 --- a/es2panda/test/parser/ts/test_generic-expected.txt +++ b/es2panda/test/parser/ts/test_generic-expected.txt @@ -1395,19 +1395,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 27, - "column": 162 - }, - "end": { - "line": 27, - "column": 163 - } - } - }, { "type": "TSInterfaceDeclaration", "body": { @@ -6047,19 +6034,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 68, - "column": 57 - }, - "end": { - "line": 68, - "column": 58 - } - } - }, { "type": "TSTypeAliasDeclaration", "id": { @@ -6380,19 +6354,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 69, - "column": 61 - }, - "end": { - "line": 69, - "column": 62 - } - } - }, { "type": "ExpressionStatement", "expression": { diff --git a/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt b/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt index cad24d6196..1ce11c47c3 100644 --- a/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt +++ b/es2panda/test/parser/ts/type_checker/typeAliasUsedAsValue-expected.txt @@ -211,19 +211,6 @@ } } }, - { - "type": "EmptyStatement", - "loc": { - "start": { - "line": 17, - "column": 71 - }, - "end": { - "line": 17, - "column": 72 - } - } - }, { "type": "VariableDeclaration", "declarations": [ -- Gitee