diff --git a/ets2panda/parser/ETSparser.cpp b/ets2panda/parser/ETSparser.cpp index 9aa2bcd87f5eeba1c9240c13a432372aa3f721e2..5364fc13dae34abefd15139dc79a7d0cab7751bd 100644 --- a/ets2panda/parser/ETSparser.cpp +++ b/ets2panda/parser/ETSparser.cpp @@ -996,7 +996,7 @@ ir::Statement *ETSParser::ParseExport(lexer::SourcePosition startLoc, ir::Modifi // re-export directive auto *reExportDeclaration = ParseImportPathBuildImport(std::move(specifiers), true, startLoc, ir::ImportKinds::ALL); auto reExport = AllocNode(reExportDeclaration, std::vector(), - GetProgram()->SourceFilePath(), Allocator()); + GetProgram()->AbsoluteName(), Allocator()); reExport->AddModifier(modifiers); return reExport; } diff --git a/ets2panda/test/ast/parser/ets/re_export/export_5.ets b/ets2panda/test/ast/parser/ets/re_export/export_5.ets new file mode 100644 index 0000000000000000000000000000000000000000..745a950975fb7924475c94bac200e7b35b780212 --- /dev/null +++ b/ets2panda/test/ast/parser/ets/re_export/export_5.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {test2} from './re_export_16' + +export class test1 {} diff --git a/ets2panda/test/ast/parser/ets/re_export/export_6.ets b/ets2panda/test/ast/parser/ets/re_export/export_6.ets new file mode 100644 index 0000000000000000000000000000000000000000..1628fe5be5d3aae03206746c734c8d2e322068e8 --- /dev/null +++ b/ets2panda/test/ast/parser/ets/re_export/export_6.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {test1} from './export_5' + +export class test2 {} diff --git a/ets2panda/test/ast/parser/ets/re_export/re_export_16.ets b/ets2panda/test/ast/parser/ets/re_export/re_export_16.ets new file mode 100644 index 0000000000000000000000000000000000000000..e98c8fe2301552a787b7cbf41a270334ad439deb --- /dev/null +++ b/ets2panda/test/ast/parser/ets/re_export/re_export_16.ets @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 {test2} from './export_6' \ No newline at end of file diff --git a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt index c44899c0eb50d78101a987d6f7856ef0f297ede7..c63c252969063e2164db16774d2e50678b4f5f2e 100644 --- a/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt +++ b/ets2panda/test/test-lists/srcdumper/srcdumper-ets-ignored.txt @@ -17,6 +17,9 @@ ast/parser/ets/import_tests/export_and_import_class.ets ast/parser/ets/import_tests/export_and_import_top_level.ets ast/parser/ets/re_export/import_11.ets ast/parser/ets/re_export/import_12.ets +ast/parser/ets/re_export/export_5.ets +ast/parser/ets/re_export/export_6.ets +ast/parser/ets/re_export/re_export_16.ets ast/parser/ets/re_export/re_export_11.ets ast/parser/ets/re_export/re_export_12.ets ast/parser/ets/re_export/re_export_5.ets