Add back ctor for compatibility

This commit is contained in:
Clément Fournier
2024-04-09 13:44:07 +02:00
parent 8f1e6b077a
commit 835abc80f7

View File

@ -44,6 +44,20 @@ public class AntlrToken implements GenericToken<AntlrToken> {
this.kind = token.getType();
}
/**
* @deprecated Don't create antlr tokens directly, use an {@link AntlrTokenManager}
*/
@Deprecated
public AntlrToken(final Token token, final AntlrToken previousComment, TextDocument textDoc) {
this.previousComment = previousComment;
this.textDoc = textDoc;
this.image = token.getText();
this.startOffset = token.getStartIndex();
this.endOffset = token.getStopIndex() + 1; // exclusive
this.channel = token.getChannel();
this.kind = token.getType();
}
@Override
public AntlrToken getNext() {
return next;