HI
I think we could add a preprocessor instruction to set the type of diagram, like this:
!diagram SEQUENCE
So, the parser could use this information to validate the syntax and generate the diagram, and the type of the diagram would become clear from the begenning to the developer too. This could be optional flag, but could be usefull to reduces the parsing time.
This instruction could be defined to be at first line of the diagram:
@startuml
!diagram CLASS
......
@enduml
Best regards
Guilherme Weizenmann