Skip to content

python - allow unterminated strings in # inline comments #488

@adamfk

Description

@adamfk

Currently can't support something like this:

State1
enter / count += 1 # it's time to increment

The ' causes a parsing failure:

Failed parsing node label.
Reason(s): no viable alternative at input ' it'' at line 2 column 23. Offending symbol: `'`.
           mismatched input ''' expecting <EOF> at line 2 column 23. Offending symbol: `'`.
DiagramNode:
    id: State1
    label: `State1
            enter / count += 1 # it's time to increment
            exit  /`
    parent.id: MySm (parent follows below)

Supporting inline comments will be difficult for various programming languages as they can differ dramatically. Like ocaml (* this is also an enclosed comment *), pascal `(: this is an enclosed comment :). See here.

Might need to standardize on a single style for StateSmith like /* */. This works right now for parsing, but it isn't translated to the user's desired language right now. User's can post process generated file in the mean time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Someday...

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions