// Path: app/src/main/java/com/annimon/hotarufx/exceptions/LexerException.java
// public class LexerException extends RuntimeException {
// 
//     public LexerException(String message) {
//         super(message);
//     }
// 
//     public LexerException(SourcePosition position, String message) {
//         super(position.toString() + " " + message);
//     }
// }


import com.annimon.hotarufx.exceptions.LexerException;
import java.util.ArrayList;
import java.util.List;
        if (position >= length) return '\0';
        return input.charAt(position);
    }

    protected SourcePosition currentPosition() {
        return new SourcePosition(pos, row, col);
    }

    protected Token addToken(HotaruTokenId tokenId) {
        return addToken(tokenId, buffer.toString());
    }

    protected Token addToken(HotaruTokenId tokenId, String text) {
        return addToken(tokenId, text, text.length());
    }

    protected Token addToken(HotaruTokenId tokenId, String text, int length) {
        final var token = createToken(tokenId, text, length);
        tokens.add(token);
        return token;
    }

    protected Token createToken(HotaruTokenId tokenId) {
        return createToken(tokenId, buffer.toString(), buffer.length());
    }

    protected Token createToken(HotaruTokenId tokenId, String text, int length) {
        return new Token(tokenId, text, length, currentPosition());
    }

// Path: app/src/main/java/com/annimon/hotarufx/exceptions/LexerException.java
// public class LexerException extends RuntimeException {
// 
//     public LexerException(String message) {
//         super(message);
//     }
// 
//     public LexerException(SourcePosition position, String message) {
//         super(position.toString() + " " + message);
//     }
// }


// Path: app/src/main/java/com/annimon/hotarufx/lexer/Lexer.java
import com.annimon.hotarufx.exceptions.LexerException;
import java.util.ArrayList;
import java.util.List;

        if (position >= length) return '\0';
        return input.charAt(position);
    }

    protected SourcePosition currentPosition() {
        return new SourcePosition(pos, row, col);
    }

    protected Token addToken(HotaruTokenId tokenId) {
        return addToken(tokenId, buffer.toString());
    }

    protected Token addToken(HotaruTokenId tokenId, String text) {
        return addToken(tokenId, text, text.length());
    }

    protected Token addToken(HotaruTokenId tokenId, String text, int length) {
        final var token = createToken(tokenId, text, length);
        tokens.add(token);
        return token;
    }

    protected Token createToken(HotaruTokenId tokenId) {
        return createToken(tokenId, buffer.toString(), buffer.length());
    }

    protected Token createToken(HotaruTokenId tokenId, String text, int length) {
        return new Token(tokenId, text, length, currentPosition());
    }

    protected LexerException error(String message) {