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

jaskell.parsec.common.EndOfLine 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.common;

import static jaskell.parsec.common.Txt.text;

import jaskell.parsec.ParsecException;

import java.io.EOFException;

/**
 * Created by zhaonf on 16/1/10.
 * EndOfLine 尝试匹配 \r\n 或 \n
 */
public class EndOfLine
    implements Parsec {
    private final Parsec parsec =
        new Choice<>(new Text("\n"), new Text("\r\n"));
    @Override
    public String parse(State s)
            throws EOFException, ParsecException {
        return parsec.parse(s);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy