forked from ZenUml/core
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Feature Request
Description
Currently, the DSL does not support named parameters in method calls. We would like to add support for syntax like:
A.method(param=value)
A.method(param1=value1, param2=value2)
Current Behavior
The parser only supports positional parameters:
A.method(value1, value2)
Desired Behavior
Support both positional and named parameters:
// Named parameters
A.method(userId=123, name="John")
// Mixed (positional first, then named)
A.method(123, name="John")
// Still support existing positional syntax
A.method(123, "John")
Use Cases
- Improved readability when method calls have many parameters
- Self-documenting code where parameter names clarify intent
- Better alignment with modern programming language conventions
- Enhanced UML sequence diagram expressiveness
Implementation Notes
This would require updates to:
- ANTLR grammar files in
src/g4/ - Parser logic in
src/parser/ - Message rendering components to display named parameters
Acceptance Criteria
- Grammar supports
param=valuesyntax in method calls - Parser correctly extracts named parameters
- Rendered diagrams display named parameters appropriately
- Tests cover both named and positional parameter scenarios
- Backward compatibility with existing positional syntax
Metadata
Metadata
Assignees
Labels
No labels