Python pygments.token.Comment.Multiline() Examples

The following are 3 code examples of pygments.token.Comment.Multiline(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pygments.token.Comment , or try the search function .
Example #1
Source File: email.py    From pygments with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def get_x_header_tokens(self, match):
        if self.highlight_x:
            # field
            yield match.start(1), Name.Tag, match.group(1)

            # content
            default_actions = self.get_tokens_unprocessed(
                match.group(2), stack=("root", "header"))
            for item in default_actions:
                yield item
        else:
            # lowlight
            yield match.start(1), Comment.Special, match.group(1)
            yield match.start(2), Comment.Multiline, match.group(2) 
Example #2
Source File: test_sql.py    From pygments with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def test_can_lex_comments(lexer):
    _assert_tokens_match(lexer, '--\n', ((Comment.Single, '--\n'),))
    _assert_tokens_match(lexer, '/**/', (
        (Comment.Multiline, '/*'), (Comment.Multiline, '*/')
    ))
    _assert_tokens_match(lexer, '/*/**/*/', (
        (Comment.Multiline, '/*'),
        (Comment.Multiline, '/*'),
        (Comment.Multiline, '*/'),
        (Comment.Multiline, '*/'),
    )) 
Example #3
Source File: email.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def get_x_header_tokens(self, match):
        if self.highlight_x:
            # field
            yield match.start(1), Name.Tag, match.group(1)

            # content
            default_actions = self.get_tokens_unprocessed(
                match.group(2), stack=("root", "header"))
            for item in default_actions:
                yield item
        else:
            # lowlight
            yield match.start(1), Comment.Special, match.group(1)
            yield match.start(2), Comment.Multiline, match.group(2)