antlr4-intellij-adaptor: syntax error highlighting quirks

This issue was migrated from this jetbrains dev forum post; you can the whole discussion up to this point there. I kind of hijacked that thread – sorry about that! Probably should’ve moved stuff here sooner 😃

Here are some of the latest syntax error highlighting quirks I’ve stumbled across.

I have a uses/import list rule that looks like:

usesList
    :   'uses' ID (',' ID)* ';'
    ;

So I type

Precis X;
     uses y

end X;

doesn’t point out the missing semicolon after y. If I do something like uses x, y it’ll complain – so it’s only for lists with a single element then I guess?

Another one too:

Precis X;

     //error, should be something (not semi colon) immediately after ':'
     Definition x : ;
end X;

The grammar for this lang can be read here. It has a fairly big expression hierarchy and just two types of declarations: definitions and theorems. Definition’s can take on several signature styles such prefix, postfix, outfix. I’ve only tried the prefix right now, before I ran into the issue mentioned above.

The rules composing the definition construct mentioned above starts at mathStandardDefinitionDecl (the signature referenced will be mathPrefixDefinitionSig).

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 1
  • Comments: 21 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@Shan1024 I published patch here; my fork contains many other changes, unfortunately I cannot make regular PR, it will take too much time.