From 5db9976b94d1819c51f5d7a677333d7829b00647 Mon Sep 17 00:00:00 2001 From: ambujsingh Date: Thu, 20 Aug 2026 16:40:19 +0530 Subject: [PATCH] fix(common.pest): prevent arrow_direction from greedily matching identifier prefixes Direction keywords (l, r, u, d, ri, do, le, up, right, left, down) were consumed as arrow_direction when arrow_middle? tried to match a component alias starting with those letters (e.g. `latst_`, `right_svc`). Replace the positive lookahead over specific successor tokens with a negative word-boundary check `!(ASCII_ALPHANUMERIC | "_")`, which is simpler and decoupled from the arrow token set. Add regression tests covering: - All four single-char directions as target alias (no_decor) - Two-char direction prefix (ri) as alias - Full keyword prefix (right_svc) as alias - Direction-prefix alias on the source (LHS) side - Interface-required context with direction-prefix alias (documentation) --- .../output.json | 54 +++++++++++++++++++ ...relation_alias_starts_with_d_no_decor.puml | 22 ++++++++ .../output.json | 54 +++++++++++++++++++ ...relation_alias_starts_with_l_no_decor.puml | 23 ++++++++ .../output.json | 54 +++++++++++++++++++ ...relation_alias_starts_with_r_no_decor.puml | 22 ++++++++ .../output.json | 54 +++++++++++++++++++ ...elation_alias_starts_with_ri_no_decor.puml | 22 ++++++++ .../output.json | 54 +++++++++++++++++++ ...tion_alias_starts_with_right_no_decor.puml | 22 ++++++++ .../output.json | 54 +++++++++++++++++++ ...relation_alias_starts_with_u_no_decor.puml | 22 ++++++++ .../output.json | 54 +++++++++++++++++++ ...ired_to_component_alias_starts_with_l.puml | 23 ++++++++ .../output.json | 54 +++++++++++++++++++ ...n_source_alias_starts_with_l_no_decor.puml | 22 ++++++++ .../puml_parser/src/grammar/common.pest | 6 +-- .../tests/component_resolver_test.rs | 40 ++++++++++++++ 18 files changed, 652 insertions(+), 4 deletions(-) create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_d_no_decor/relation_alias_starts_with_d_no_decor.puml create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_l_no_decor/relation_alias_starts_with_l_no_decor.puml create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_r_no_decor/relation_alias_starts_with_r_no_decor.puml create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_ri_no_decor/relation_alias_starts_with_ri_no_decor.puml create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_right_no_decor/relation_alias_starts_with_right_no_decor.puml create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_alias_starts_with_u_no_decor/relation_alias_starts_with_u_no_decor.puml create mode 100644 plantuml/parser/integration_test/component_diagram/relation_interface_required_to_component_alias_starts_with_l/output.json create mode 100644 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 create mode 100644 plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/output.json create mode 100644 plantuml/parser/integration_test/component_diagram/relation_source_alias_starts_with_l_no_decor/relation_source_alias_starts_with_l_no_decor.puml 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");