Package org.plumelib.util
Class EntryReader.CommentFormat
java.lang.Object
org.plumelib.util.EntryReader.CommentFormat
- Enclosing class:
- EntryReader
This class informs
EntryReader where a comment begins and ends.
No quoting is supported. That is, EntryReader does not attempt to infer whether a
comment regex matches within (say) a string in the input text. To prevent a comment marker from
being matched, embed it in a fenced code block.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EntryReader.CommentFormatA CommentFormat for C-style comments.static final EntryReader.CommentFormatA CommentFormat for C-style comments, only at the beginning of a line.static final EntryReader.CommentFormatA CommentFormat for HTML-style comments.static final EntryReader.CommentFormatA CommentFormat for HTML-style comments, only at the beginning of a line.static final EntryReader.CommentFormatA CommentFormat that supports no comments.static final EntryReader.CommentFormatA CommentFormat for Shell/Python-style comments.static final EntryReader.CommentFormatA CommentFormat for Shell/Python-style comments, only at the beginning of a line.static final EntryReader.CommentFormatA CommentFormat for TeX/LaTeX-style comments.static final EntryReader.CommentFormatA CommentFormat for TeX/LaTeX-style comments, only at the beginning of a line. -
Constructor Summary
ConstructorsConstructorDescriptionCommentFormat(@Nullable @Regex String lineCommentStart) Creates a CommentFormat that does not match multi-line comments.CommentFormat(@Nullable @Regex String lineCommentStart, @Nullable @Regex String multilineCommentStart, @Nullable @Regex String multilineCommentEnd) Creates a CommentFormat.CommentFormat(@Nullable Pattern lineCommentStart, @Nullable Pattern multilineCommentStart, @Nullable Pattern multilineCommentEnd) Creates a CommentFormat. -
Method Summary
-
Field Details
-
NONE
A CommentFormat that supports no comments. -
C
A CommentFormat for C-style comments. -
C_AT_START_OF_LINE
A CommentFormat for C-style comments, only at the beginning of a line. -
HTML
A CommentFormat for HTML-style comments. -
HTML_AT_START_OF_LINE
A CommentFormat for HTML-style comments, only at the beginning of a line. -
SHELL
A CommentFormat for Shell/Python-style comments. -
SHELL_AT_START_OF_LINE
A CommentFormat for Shell/Python-style comments, only at the beginning of a line. -
TEX
A CommentFormat for TeX/LaTeX-style comments. -
TEX_AT_START_OF_LINE
A CommentFormat for TeX/LaTeX-style comments, only at the beginning of a line.
-
-
Constructor Details
-
CommentFormat
public CommentFormat(@Nullable @Regex String lineCommentStart, @Nullable @Regex String multilineCommentStart, @Nullable @Regex String multilineCommentEnd) Creates a CommentFormat.- Parameters:
lineCommentStart- regular expression that matches a single-line commentmultilineCommentStart- regular expression that matches the start of a multi-line commentmultilineCommentEnd- regular expression that matches the end of a multi-line comment
-
CommentFormat
Creates a CommentFormat that does not match multi-line comments.- Parameters:
lineCommentStart- regular expression that matches a single-line comment
-
CommentFormat
public CommentFormat(@Nullable Pattern lineCommentStart, @Nullable Pattern multilineCommentStart, @Nullable Pattern multilineCommentEnd) Creates a CommentFormat.- Parameters:
lineCommentStart- regular expression that matches a single-line commentmultilineCommentStart- regular expression that matches the start of a multi-line commentmultilineCommentEnd- regular expression that matches the end of a multi-line comment
-