// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Token.java
// public abstract class Token<T> {
// 
//     private final T value;
//     private final int length;
// 
//     private Token(T value, int length) {
//         this.value = value;
//         this.length = length;
//     }
// 
//     public static Token<String> Keyword(String value) {
//         return new KeywordToken(value);
//     }
// 
//     public static Token<String> Ident(String value) {
//         return new IdentToken(value);
//     }
// 
//     public static Token<String> String(int length, String value) {
//         return new StringToken(length, value);
//     }
// 
//     public static Token<Integer> Int(int length, int value) {
//         return new IntToken(length, value);
//     }
// 
//     public static Token<Float> Float(int length, float value) {
//         return new FloatToken(length, value);
//     }
// 
//     public static <T> Token<T> Generic(String kind, int length, T value) {
//         return new GenericToken<>(kind, length, value);
//     }
// 
//     public T value() {
//         return this.value;
//     }
// 
//     public int length() {
//         return this.length;
//     }
// 
//     //
//     // Implementations
//     //
// 
//     public static class KeywordToken extends Token<String> {
//         private KeywordToken(String value) {
//             super(value, value.length());
//         }
//     }
// 
//     public static class GenericToken<T> extends Token<T> {
//         private final String kind;
// 
//         public GenericToken(String kind, int length, T value) {
//             super(value, length);
//             this.kind = kind;
//         }
// 
//         public String kind() {
//             return kind;
//         }
//     }
// 
//     public static class IdentToken extends Token<String> {
//         private IdentToken(String value) {
//             super(value, value.length());
//         }
//     }
// 
//     public static class StringToken extends Token<String> {
//         private StringToken(int length, String value) {
//             super(value, length);
//         }
//     }
// 
//     public static class IntToken extends Token<Integer> {
//         private IntToken(int length, int value) {
//             super(value, length);
//         }
//     }
// 
//     public static class FloatToken extends Token<Float> {
//         private FloatToken(int length, float value) {
//             super(value, length);
//         }
//     }
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/core/Cases.java
// static <T> Var.WithoutInnerCapture<T, T> Var() {
//     return Var(Any());
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<Integer> Hexa() {
//     return new HexadecimalRecognizer();
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> Ident(String value) {
//     return new IdentifierRecognizer(value);
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<Integer> Int() {
//     return new IntRecognizer();
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> Kwd(String value) {
//     return new KeywordRecognizer(value);
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> QuotedString() {
//     return new QuotedStringRecognizer();
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> String() {
//     return new StringRecognizer();
// }


import org.junit.Test;
import org.smallibs.suitcase.cases.genlex.Token;
import static org.assertj.core.api.Assertions.assertThat;
import static org.smallibs.suitcase.cases.core.Cases.Var;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Hexa;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Ident;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Int;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Kwd;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.QuotedString;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.String;

    @Test
    public void shouldMatchAString() throws Exception {
        Matcher<CharSequence, Boolean> matcher = Matcher.create();

        matcher.caseOf(String()).then(true);

        assertThat(matcher.match("\"123\"")).isTrue();
    }

    @Test
    public void shouldMatchAndRetrieveAString() throws Exception {
        Matcher<CharSequence, String> matcher = Matcher.create();

        matcher.caseOf(Var(String())).then(Token::value);

        assertThat(matcher.match("\"123\"")).isEqualTo("123");
    }

    @Test
    public void shouldMatchAQuotedString() throws Exception {
        Matcher<CharSequence, Boolean> matcher = Matcher.create();

        matcher.caseOf(QuotedString()).then(true);

        assertThat(matcher.match("'123'")).isTrue();
    }

    @Test
    public void shouldMatchAndRetrieveAQuotedString() throws Exception {
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Token.java
// public abstract class Token<T> {
// 
//     private final T value;
//     private final int length;
// 
//     private Token(T value, int length) {
//         this.value = value;
//         this.length = length;
//     }
// 
//     public static Token<String> Keyword(String value) {
//         return new KeywordToken(value);
//     }
// 
//     public static Token<String> Ident(String value) {
//         return new IdentToken(value);
//     }
// 
//     public static Token<String> String(int length, String value) {
//         return new StringToken(length, value);
//     }
// 
//     public static Token<Integer> Int(int length, int value) {
//         return new IntToken(length, value);
//     }
// 
//     public static Token<Float> Float(int length, float value) {
//         return new FloatToken(length, value);
//     }
// 
//     public static <T> Token<T> Generic(String kind, int length, T value) {
//         return new GenericToken<>(kind, length, value);
//     }
// 
//     public T value() {
//         return this.value;
//     }
// 
//     public int length() {
//         return this.length;
//     }
// 
//     //
//     // Implementations
//     //
// 
//     public static class KeywordToken extends Token<String> {
//         private KeywordToken(String value) {
//             super(value, value.length());
//         }
//     }
// 
//     public static class GenericToken<T> extends Token<T> {
//         private final String kind;
// 
//         public GenericToken(String kind, int length, T value) {
//             super(value, length);
//             this.kind = kind;
//         }
// 
//         public String kind() {
//             return kind;
//         }
//     }
// 
//     public static class IdentToken extends Token<String> {
//         private IdentToken(String value) {
//             super(value, value.length());
//         }
//     }
// 
//     public static class StringToken extends Token<String> {
//         private StringToken(int length, String value) {
//             super(value, length);
//         }
//     }
// 
//     public static class IntToken extends Token<Integer> {
//         private IntToken(int length, int value) {
//             super(value, length);
//         }
//     }
// 
//     public static class FloatToken extends Token<Float> {
//         private FloatToken(int length, float value) {
//             super(value, length);
//         }
//     }
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/core/Cases.java
// static <T> Var.WithoutInnerCapture<T, T> Var() {
//     return Var(Any());
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<Integer> Hexa() {
//     return new HexadecimalRecognizer();
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> Ident(String value) {
//     return new IdentifierRecognizer(value);
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<Integer> Int() {
//     return new IntRecognizer();
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> Kwd(String value) {
//     return new KeywordRecognizer(value);
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> QuotedString() {
//     return new QuotedStringRecognizer();
// }
// 
// Path: src/main/java/org/smallibs/suitcase/cases/genlex/Tokenizer.java
// public static Tokenizer<String> String() {
//     return new StringRecognizer();
// }


// Path: src/test/java/org/smallibs/suitcase/match/TokenizerMatcherTest.java
import org.junit.Test;
import org.smallibs.suitcase.cases.genlex.Token;
import static org.assertj.core.api.Assertions.assertThat;
import static org.smallibs.suitcase.cases.core.Cases.Var;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Hexa;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Ident;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Int;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.Kwd;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.QuotedString;
import static org.smallibs.suitcase.cases.genlex.Tokenizer.String;


    @Test
    public void shouldMatchAString() throws Exception {
        Matcher<CharSequence, Boolean> matcher = Matcher.create();

        matcher.caseOf(String()).then(true);

        assertThat(matcher.match("\"123\"")).isTrue();
    }

    @Test
    public void shouldMatchAndRetrieveAString() throws Exception {
        Matcher<CharSequence, String> matcher = Matcher.create();

        matcher.caseOf(Var(String())).then(Token::value);

        assertThat(matcher.match("\"123\"")).isEqualTo("123");
    }

    @Test
    public void shouldMatchAQuotedString() throws Exception {
        Matcher<CharSequence, Boolean> matcher = Matcher.create();

        matcher.caseOf(QuotedString()).then(true);

        assertThat(matcher.match("'123'")).isTrue();
    }

    @Test
    public void shouldMatchAndRetrieveAQuotedString() throws Exception {
        Matcher<CharSequence, String> matcher = Matcher.create();