Consumes all tokens within parentheses as comments.
Parenthetical comments in mime-headers can be nested within one another. The
outer-level continues after an inner-comment ends. Additionally,
quoted-literals may exist with comments as well meaning a parenthesis inside
a quoted string would not begin or end a comment section.
In order to satisfy these specifications, CommentConsumer inherits from
GenericConsumer which defines CommentConsumer and QuotedStringConsumer as
sub-consumers.
Examples:
X-Mime-Header: Some value (comment)
X-Mime-Header: Some value (comment (nested comment) still in comment)
X-Mime-Header: Some value (comment "and part of original ) comment" -
still a comment)
- author Zaahid Bateson
Methods |
Properties |
Methods |
protected advanceToNextToken(Iterator $tokens, bool $isStartToken) Calls $tokens->next() and returns. The default implementation checks if the current token is an end token,
|
protected getPartForToken(string $token, bool $isLiteral) Instantiates and returns Part\Token objects. Tokens from this and sub-consumers are combined into a Part\CommentPart
|
protected getTokenSeparators() : array Returns patterns matching open and close parenthesis characters
|
protected isEndToken(string $token) : bool Returns true if the token is a close parenthesis character, ')'. |
protected isStartToken(string $token) : bool Returns true if the token is an open parenthesis character, '('. |
protected processParts(array $parts) : array Post processing involves creating a single Part\CommentPart out of
|
Methods |