diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/output.json new file mode 100644 index 00000000..eb233999 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_alias_starts_with_d_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.datst_", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.datst_": { + "id": "Pkg.datst_", + "name": "Labeled", + "alias": "datst_", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/relation_alias_starts_with_d_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/relation_alias_starts_with_d_no_decor.puml new file mode 100644 index 00000000..bff0d2c3 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/relation_alias_starts_with_d_no_decor.puml @@ -0,0 +1,22 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "A" as A <> + component "Labeled" as datst_ <> + A -- datst_ : uses +} + +@enduml diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/output.json new file mode 100644 index 00000000..3c85bc67 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_alias_starts_with_l_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.latst_", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.latst_": { + "id": "Pkg.latst_", + "name": "Labeled", + "alias": "latst_", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/relation_alias_starts_with_l_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/relation_alias_starts_with_l_no_decor.puml new file mode 100644 index 00000000..496fa2b3 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/relation_alias_starts_with_l_no_decor.puml @@ -0,0 +1,23 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "A" as A <> + component "Labeled" as latst_ <> + A -- latst_ : uses +} + +@enduml + diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/output.json new file mode 100644 index 00000000..2f985893 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_alias_starts_with_r_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.ratst_", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.ratst_": { + "id": "Pkg.ratst_", + "name": "Labeled", + "alias": "ratst_", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/relation_alias_starts_with_r_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/relation_alias_starts_with_r_no_decor.puml new file mode 100644 index 00000000..e4e7a5bf --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/relation_alias_starts_with_r_no_decor.puml @@ -0,0 +1,22 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "A" as A <> + component "Labeled" as ratst_ <> + A -- ratst_ : uses +} + +@enduml diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/output.json new file mode 100644 index 00000000..faf4e946 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_alias_starts_with_ri_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.riatst_", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.riatst_": { + "id": "Pkg.riatst_", + "name": "Labeled", + "alias": "riatst_", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/relation_alias_starts_with_ri_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/relation_alias_starts_with_ri_no_decor.puml new file mode 100644 index 00000000..1618f6b9 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/relation_alias_starts_with_ri_no_decor.puml @@ -0,0 +1,22 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "A" as A <> + component "Labeled" as riatst_ <> + A -- riatst_ : uses +} + +@enduml diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/output.json new file mode 100644 index 00000000..30a5f616 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_alias_starts_with_right_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.right_svc", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.right_svc": { + "id": "Pkg.right_svc", + "name": "Labeled", + "alias": "right_svc", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/relation_alias_starts_with_right_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/relation_alias_starts_with_right_no_decor.puml new file mode 100644 index 00000000..0f8d67db --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/relation_alias_starts_with_right_no_decor.puml @@ -0,0 +1,22 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "A" as A <> + component "Labeled" as right_svc <> + A -- right_svc : uses +} + +@enduml diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/output.json new file mode 100644 index 00000000..37f0bead --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_alias_starts_with_u_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.uatst_", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.uatst_": { + "id": "Pkg.uatst_", + "name": "Labeled", + "alias": "uatst_", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/relation_alias_starts_with_u_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/relation_alias_starts_with_u_no_decor.puml new file mode 100644 index 00000000..e55110a5 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/relation_alias_starts_with_u_no_decor.puml @@ -0,0 +1,22 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "A" as A <> + component "Labeled" as uatst_ <> + A -- uatst_ : uses +} + +@enduml diff --git a/plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/output.json b/plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/output.json new file mode 100644 index 00000000..7a409789 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/output.json @@ -0,0 +1,54 @@ +{ + "relation_interface_required_to_component_alias_starts_with_l.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.latst_": { + "id": "Pkg.latst_", + "name": "Labeled", + "alias": "latst_", + "parent_id": "Pkg", + "comp_type": "Interface", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.latst_", + "annotation": "requires", + "relation_type": "InterfaceBinding", + "source_role": "Required", + "source_location": { + "file": "", + "line": 20 + } + } + ], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/relation_interface_required_to_component_alias_starts_with_l.puml b/plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/relation_interface_required_to_component_alias_starts_with_l.puml new file mode 100644 index 00000000..4526073a --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/relation_interface_required_to_component_alias_starts_with_l.puml @@ -0,0 +1,23 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + interface "Labeled" as latst_ + component "A" as A <> + + A --( latst_ : requires +} + +@enduml diff --git a/plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/output.json b/plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/output.json new file mode 100644 index 00000000..cf84b5a1 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/output.json @@ -0,0 +1,54 @@ +{ + "relation_source_alias_starts_with_l_no_decor.puml": { + "Pkg": { + "id": "Pkg", + "name": "Pkg", + "alias": "Pkg", + "parent_id": null, + "comp_type": "Package", + "stereotype": null, + "relations": [], + "source_location": { + "file": "", + "line": 16 + } + }, + "Pkg.latst_": { + "id": "Pkg.latst_", + "name": "Labeled", + "alias": "latst_", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [ + { + "target": "Pkg.A", + "annotation": "uses", + "relation_type": "Association", + "source_role": "None", + "source_location": { + "file": "", + "line": 19 + } + } + ], + "source_location": { + "file": "", + "line": 17 + } + }, + "Pkg.A": { + "id": "Pkg.A", + "name": "A", + "alias": "A", + "parent_id": "Pkg", + "comp_type": "Component", + "stereotype": "component", + "relations": [], + "source_location": { + "file": "", + "line": 18 + } + } + } +} diff --git a/plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/relation_source_alias_starts_with_l_no_decor.puml b/plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/relation_source_alias_starts_with_l_no_decor.puml new file mode 100644 index 00000000..ddc4b5e5 --- /dev/null +++ b/plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/relation_source_alias_starts_with_l_no_decor.puml @@ -0,0 +1,22 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +package "Pkg" as Pkg { + component "Labeled" as latst_ <> + component "A" as A <> + latst_ -- A : uses +} + +@enduml diff --git a/plantuml/parser/puml_parser/src/grammar/common.pest b/plantuml/parser/puml_parser/src/grammar/common.pest index e9f54acb..bbec4d45 100644 --- a/plantuml/parser/puml_parser/src/grammar/common.pest +++ b/plantuml/parser/puml_parser/src/grammar/common.pest @@ -285,8 +285,6 @@ arrow_mid_decor = @{ "(0)" | "(0" | "0)" | "()" | "(" | ")" | "0" } // ---------- Direction ---------- arrow_direction = @{ - "up" | "u" - | "right" | "ri" | "r" - | "down" | "do" | "d" - | "left" | "le" | "l" + ("up" | "u" | "right" | "ri" | "r" | "down" | "do" | "d" | "left" | "le" | "l") + ~ !(ASCII_ALPHANUMERIC | "_") } diff --git a/plantuml/parser/puml_resolver/src/component_diagram/tests/component_resolver_test.rs b/plantuml/parser/puml_resolver/src/component_diagram/tests/component_resolver_test.rs index 8d048ab9..99f044a6 100644 --- a/plantuml/parser/puml_resolver/src/component_diagram/tests/component_resolver_test.rs +++ b/plantuml/parser/puml_resolver/src/component_diagram/tests/component_resolver_test.rs @@ -204,6 +204,46 @@ fn test_relation_interface_required_to_component() { run_component_resolver_case("relation_interface_required_to_component"); } +#[test] +fn test_relation_interface_required_to_component_alias_starts_with_l() { + run_component_resolver_case("relation_interface_required_to_component_alias_starts_with_l"); +} + +#[test] +fn test_relation_alias_starts_with_l_no_decor() { + run_component_resolver_case("relation_alias_starts_with_l_no_decor"); +} + +#[test] +fn test_relation_alias_starts_with_u_no_decor() { + run_component_resolver_case("relation_alias_starts_with_u_no_decor"); +} + +#[test] +fn test_relation_alias_starts_with_r_no_decor() { + run_component_resolver_case("relation_alias_starts_with_r_no_decor"); +} + +#[test] +fn test_relation_alias_starts_with_d_no_decor() { + run_component_resolver_case("relation_alias_starts_with_d_no_decor"); +} + +#[test] +fn test_relation_alias_starts_with_ri_no_decor() { + run_component_resolver_case("relation_alias_starts_with_ri_no_decor"); +} + +#[test] +fn test_relation_alias_starts_with_right_no_decor() { + run_component_resolver_case("relation_alias_starts_with_right_no_decor"); +} + +#[test] +fn test_relation_source_alias_starts_with_l_no_decor() { + run_component_resolver_case("relation_source_alias_starts_with_l_no_decor"); +} + #[test] fn test_relation_interface_provided_to_component() { run_component_resolver_case("relation_interface_provided_to_component");