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

fitnesse.wikitext.parser.Comment Maven / Gradle / Ivy

There is a newer version: 20241026
Show newest version
package fitnesse.wikitext.parser;

public class Comment extends SymbolType implements Rule, Translation {
    public static final Comment symbolType = new Comment();

    public Comment() {
        super("Comment");
        wikiMatcher(new Matcher().startLine().string("#"));
        wikiRule(this);
        htmlTranslation(this);
    }

    @Override
    public Maybe parse(Symbol current, Parser parser) {
        String literal = parser.parseLiteral(Newline);
        if (!parser.atEnd()) literal += "\n";
        return new Maybe<>(current.add(literal));
    }

    @Override
    public String toTarget(Translator translator, Symbol symbol) {
        return "";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy