-
Notifications
You must be signed in to change notification settings - Fork 81
Description
From discussion here: #492 (comment)
Rather than try to keep up with all the various features in PlantUML, we should allow users to instruct StateSmith to ignore everything between special comments.
⚠️ Note! You should be careful with this feature. It is rather powerful. You could abuse it to hide states and transitions from StateSmith (which I wouldn't recommend) 🙃. Best to just hide unsupported styling from StateSmith.
Option A (chosen):
Easiest to parse with confidence. A bit noisy, but also very clear.
' <StateSmith:ignore>
mainframe Some Title
!theme spacelab
' </StateSmith:ignore>
@startuml MySm
[*] -> a
a -> b
@endumlPossible Antlr4 lexer rule:
SS_IGNORE_COMMENT:
(START_OF_INPUT | LINE_ENDER)
HWS* // optional horizontal whitespace
SINGLE_QUOTE
HWS* // optional horizontal whitespace
'<StateSmith:ignore>'
.*?
'</StateSmith:ignore>'
-> skip
;Option B (not chosen):
This is less noisy looking, but parsing with confidence is kinda annoying as ANTLR4 can't do lexer lookaheads.
' StateSmith:ignore-begin
mainframe Some Title
!theme spacelab
' StateSmith:ignore-end
@startuml MySm
[*] -> a
a -> b
@endumlDecision
Go with Option A for now. It is easy to do the "right" thing. We can add support for B if we find A annoying after some use.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status