forked from jasder/antlr
clean up
This commit is contained in:
parent
db66257d7e
commit
37396d6040
|
@ -52,16 +52,18 @@ public class CommonTokenFactory implements TokenFactory<CommonToken> {
|
|||
int channel, int start, int stop,
|
||||
int line, int charPositionInLine)
|
||||
{
|
||||
if ( copyText && text==null ) {
|
||||
CharStream input = source.getInputStream();
|
||||
text = input.getText(Interval.of(start,stop));
|
||||
}
|
||||
CommonToken t = new CommonToken(source, type, channel, start, stop);
|
||||
t.setLine(line);
|
||||
t.setCharPositionInLine(charPositionInLine);
|
||||
if ( text!=null ) {
|
||||
t.setText(text);
|
||||
}
|
||||
else {
|
||||
if ( copyText ) {
|
||||
CharStream input = source.getInputStream();
|
||||
t.setText(input.getText(Interval.of(start,stop)));
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue