<commit_before>package org.antlr.v4.test;

import org.junit.Test;

/** */
public class TestLexerDFAConstruction extends BaseTest {

	@Test public void unicode() throws Exception {
		String g =
			"lexer grammar L;\n" +
			"A : '\\u0030'..'\\u8000'+ 'a' ;\n" + // TODO: FAILS; \\u not converted
			"B : '\\u0020' ;";
		String expecting =
			"";
		checkLexerDFA(g, expecting);
	}

	@Test public void keywordvsID() throws Exception {
		String g =
			"lexer grammar L2;\n" +
			"IF : 'if' ;\n" +
			"ID : 'a'..'z'+ ;\n" +
			"INT : DIGIT+ ;\n" +
			"public fragment\n" +
			"DIGIT : '0'..'9' ;";
		String expecting =
			":s1=> INT-{'0'..'9'}->:s1=> INT\n" +
			":s2=> ID-{'a'..'z'}->:s2=> ID\n" +
			":s3=> ID-'f'->:s4=> IF ID\n" +
			":s3=> ID-{'a'..'e', 'g'..'z'}->:s2=> ID\n" +
			":s4=> IF ID-{'a'..'z'}->:s2=> ID\n" +<commit_msg>add todo<commit_after>package org.antlr.v4.test;

import org.junit.Test;

/** TODO: delete since i don't built DFA anymore for lexer */
public class TestLexerDFAConstruction extends BaseTest {

	@Test public void unicode() throws Exception {
		String g =
			"lexer grammar L;\n" +
			"A : '\\u0030'..'\\u8000'+ 'a' ;\n" + // TODO: FAILS; \\u not converted
			"B : '\\u0020' ;";
		String expecting =
			"";
		checkLexerDFA(g, expecting);
	}

	@Test public void keywordvsID() throws Exception {
		String g =
			"lexer grammar L2;\n" +
			"IF : 'if' ;\n" +
			"ID : 'a'..'z'+ ;\n" +
			"INT : DIGIT+ ;\n" +
			"public fragment\n" +
			"DIGIT : '0'..'9' ;";
		String expecting =
			":s1=> INT-{'0'..'9'}->:s1=> INT\n" +
			":s2=> ID-{'a'..'z'}->:s2=> ID\n" +
			":s3=> ID-'f'->:s4=> IF ID\n" +
			":s3=> ID-{'a'..'e', 'g'..'z'}->:s2=> ID\n" +
			":s4=> IF ID-{'a'..'z'}->:s2=> ID\n" +
{'fraction_non_alphanumeric': 0.26900584795321636, 'fraction_numerical': 0.03274853801169591, 'mean_word_length': 2.671673819742489, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 33, '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': '6269289', 'n_tokens_mistral': 876, 'n_tokens_neox': 763, 'n_words': 169}