forked from jasder/antlr
Define a constant for the comments channel number
This commit is contained in:
parent
00227078e6
commit
dd3eaaa31a
|
@ -150,6 +150,8 @@ import org.antlr.v4.tool.*;
|
|||
|
||||
|
||||
@members {
|
||||
public static final int COMMENTS_CHANNEL = 2;
|
||||
|
||||
public CommonTokenStream tokens; // track stream we push to; need for context info
|
||||
public boolean isLexerRule = false;
|
||||
|
||||
|
@ -265,7 +267,7 @@ COMMENT
|
|||
// writing a formatter then you will want to preserve the comments off
|
||||
// channel, but could just skip and save token space if not.
|
||||
//
|
||||
$channel=2; // Comments are on channel 2
|
||||
$channel=COMMENTS_CHANNEL;
|
||||
}
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in New Issue