All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jaskell.parsec.NoWhitespace Maven / Gradle / Ivy

Go to download

This is a utils library for java 8 project. It include parsec combinators and sql generators library.

There is a newer version: 2.9.2
Show newest version
package jaskell.parsec;

import java.io.EOFException;

/**
 * Created by Mars Liu on 2016-01-07.
 * Whitespace 匹配空白字符
 */
public class NoWhitespace
    implements Parsec{
    @Override
    public Character parse(State s)
            throws EOFException, ParsecException {
        Character re = s.next();
        if (Character.isWhitespace(re)) {
            String message = String.format("Expect one char is not whitespace but get %c.", re);
            throw s.trap(message);
        } else {
            return re;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy