Skip to content

Conversation

@Webstonesl
Copy link
Contributor

In Rust a shebang is only if the '#!' is not followed by a '['. I added an action to fix it. If it is possible to do it with normal ANTLR, I don't know how.

@Webstonesl
Copy link
Contributor Author

There was a small issue regarding the Cpp and CSharp language specific changes. Should be fixed now.

BLOCK_COMMENT_OR_DOC: ( BLOCK_COMMENT | INNER_BLOCK_DOC | OUTER_BLOCK_DOC) -> channel (HIDDEN);

SHEBANG: {this.SOF()}? '\ufeff'? '#!' ~[\r\n]* -> channel(HIDDEN);
SHEBANG: {this.SOF()}? '\ufeff'? '#!' {this._input.LA(1) != 97}? ~[\r\n]* -> channel(HIDDEN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, this is not "target agnostic" (#4286 (comment)) because != is a target-specific operator. The entire expression should go in a base class, which is already done for both lexer and parser. Please add a "is...()" method, reference that here, and implement the methods for each of the targets.

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

Successfully merging this pull request may close these issues.

2 participants