commit
40b3bc0861
|
@ -64,9 +64,11 @@ public class CommonToken implements WritableToken, Serializable {
|
|||
this.channel = channel;
|
||||
this.start = start;
|
||||
this.stop = stop;
|
||||
if (source != null) {
|
||||
this.line = source.getLine();
|
||||
this.charPositionInLine = source.getCharPositionInLine();
|
||||
}
|
||||
}
|
||||
|
||||
public CommonToken(int type, String text) {
|
||||
this.type = type;
|
||||
|
@ -190,7 +192,7 @@ public class CommonToken implements WritableToken, Serializable {
|
|||
}
|
||||
|
||||
public CharStream getInputStream() {
|
||||
return source.getInputStream();
|
||||
return source != null ? source.getInputStream() : null;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
Loading…
Reference in New Issue