<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.libraryweasel.stinkpot

abstract class Lexer {
    String input
    int pos = 0
    char c
    final char EOF = -1

    public Lexer(String input) {
        this.input = input
        c = input[pos]
    }

    void consume() {
        pos++
        if (pos >= input.length()) c = EOF
        else c = input[pos]
    }

    abstract Token nextToken()
}<commit_msg>adding todo for adding a matcher method to Lexer similarly to the one Parser has<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.libraryweasel.stinkpot

//TODO add a match method to this class to clean up Lexer and make error handling work better
abstract class Lexer {
    String input
    int pos = 0
    char c
    final char EOF = -1

    public Lexer(String input) {
        this.input = input
        c = input[pos]
    }

    void consume() {
        pos++
        if (pos >= input.length()) c = EOF
        else c = input[pos]
    }

    abstract Token nextToken()
}
{'fraction_non_alphanumeric': 0.08721359940872137, 'fraction_numerical': 0.008869179600886918, 'mean_word_length': 2.294403892944039, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2556638', 'n_tokens_mistral': 420, 'n_tokens_neox': 402, 'n_words': 176}