java multiline comments

Issue #299 resolved
Former user created an issue

I would like to see a sample to set up multilinecomments in java a single token (or token per line). Currently my lexer keeps on resetting per newline, starting with regular parsing again. I did follow the multiline example currently with no success.

    'root': [
        (r'/\\*', Comment.Multiline, 'comment'),
        (r'//.*?\\n', Comment),

    'comment': [
        (r'[^\\*/]|\\n', Comment.Multiline),
        (r'/\\*', Comment.Multiline, '#push'),
        (r'\\*/', Comment.Multiline, '#pop'),
        (r'[\\*/]', Comment.Multiline)
    ]

btw: version 0.8.1

Reported by guest

Comments (2)

  1. gbrandl

    I don't see what you're trying to do here - I'm told that Java's `/* ... */` comments do not nest, so after `/* /*` a single `*/` ends the comment.

  2. Log in to comment