aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/internal/styles/parsing/LineParseException.java
blob: 29d36685138a53fe9202b2ce6f89f0a298ff2535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package org.zwobble.mammoth.internal.styles.parsing;

class LineParseException extends RuntimeException {
    static <T> LineParseException lineParseException(Token<T> token, String message) {
        return new LineParseException(token.getCharacterIndex(), message);
    }

    private final int characterIndex;

    private LineParseException(int characterIndex, String message) {
        super(message);
        this.characterIndex = characterIndex;
    }

    int getCharacterIndex() {
        return characterIndex;
    }
}