RegexTokeniser.rule(TokenType.CLOSE_PAREN, "\\)"),
RegexTokeniser.rule(TokenType.OPEN_SQUARE_BRACKET, "\\["),
RegexTokeniser.rule(TokenType.CLOSE_SQUARE_BRACKET, "\\]"),</BUG>
RegexTokeniser.rule(TokenType.STRING, stringPrefix + "'"),
RegexTokeniser.rule(TokenType.UNTERMINATED_STRING, stringPrefix),
<BUG>RegexTokeniser.rule(TokenType.INTEGER, "([0-9]+)"),
RegexTokeniser.rule(TokenType.CHOICE, "\\|"),
RegexTokeniser.rule(TokenType.BANG, "!")</BUG>
)
);

String stringPrefix = "'((?:\\.|[^'])*)";
RegexTokeniser<TokenType> tokeniser = new RegexTokeniser<>(
TokenType.UNKNOWN,
list(
RegexTokeniser.rule(TokenType.IDENTIFIER, "([a-zA-Z][a-zA-Z0-9\\-]*)"),
RegexTokeniser.rule(TokenType.CLASS_NAME, "(\\.(?:[a-zA-Z0-9\\-]|\\\\.)+)"),
RegexTokeniser.rule(TokenType.SYMBOL, ":|>|=>|=|\\(|\\)|\\[|\\]|\\||!"),
RegexTokeniser.rule(TokenType.WHITESPACE, "\\s+"),
RegexTokeniser.rule(TokenType.STRING, stringPrefix + "'"),
RegexTokeniser.rule(TokenType.UNTERMINATED_STRING, stringPrefix),
RegexTokeniser.rule(TokenType.INTEGER, "([0-9]+)")
)
);
