Class CommentPiece
java.lang.Object
net.diversionmc.parser.util.Pointable
net.diversionmc.parser.expression.ExpressionPiece
net.diversionmc.parser.expression.CommentPiece
Can be inline or multiline, reads until newline or ‘*/'.
Saves piece before comment and goes back to it once comment ends.
-
Constructor Summary
ConstructorsConstructorDescriptionCommentPiece(FilePointer ptr, boolean inline, ExpressionPiece original) Construct a comment piece. -
Method Summary
Modifier and TypeMethodDescriptionread(char c, FilePointer ptr) Parse a character by this piece.replace(FilePointer ptr) Called wheneverPieceResult.REPLACE_LEAVEorPieceResult.REPLACE_TAKEare used.
-
Constructor Details
-
CommentPiece
Construct a comment piece.- Parameters:
ptr- Creation position.inline- Whether this comment piece should stop at newline or at ‘*/'.original- Piece to continue parsing with at the end of comment or null to discard both pieces.
-
-
Method Details
-
read
Description copied from class:ExpressionPieceParse a character by this piece.- Specified by:
readin classExpressionPiece- Parameters:
c- Character to parse.ptr- Character position in file.- Returns:
PieceResult
-
replace
Description copied from class:ExpressionPieceCalled wheneverPieceResult.REPLACE_LEAVEorPieceResult.REPLACE_TAKEare used.- Overrides:
replacein classExpressionPiece- Parameters:
ptr- Position when replace was used.- Returns:
- Another piece to continue parsing with, or null to discard current piece.
-