Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A single line comment on the same line as } causes parser error and disables syntax highlighting #140

Open
psvo opened this issue Apr 22, 2024 · 0 comments

Comments

@psvo
Copy link

psvo commented Apr 22, 2024

A single line comment on the same line as } is accepted by the upstream parser, but not by the plugin. The parser error caused by such comment also disable syntax highlighting for the whole file.

  1. The following results in "CRLF expected, got '#'"
    workspace {
        model {
            a = softwareSystem a
        }
    } # comment
    
  2. The following results in "CRLF expected, got 'model'"
    workspace {
        model {
            a = softwareSystem a
        } # comment
    }
    

On the other hand, single line comments on the same line as { (e.g., model { # comment) are sometimes accepted and sometimes rejected by the upstream parser. It seems they are allowed after model, views, but they are not allowed after anything that takes arguments. Note, for comments after { the plugin does not produce misleading errors like (2) and they do not disable the syntax highlighting. Also, such comments are must less useful, so it does not seem worth supporting them in the few cases where upstream parser allows them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant