Some lexers are using Token.Literal.String.Regexp instead of Token.Literal.String.Regex

Issue #625 resolved
Thomas Mortagne created an issue

I'm using Pygments 1.3.1 and I wrote a custom formatter. Looks like some lexer(s) are giving me Token.Literal.String.Regexp token type sometimes which make style_for_token fail. I can see that there is a Token.Literal.String.Regex in token.py but no Token.Literal.String.Regexp, maybe it has been renamed at some point and forgotten in some lexers or it's just a error in a lexer. I can find one in lexers/agile.py line 900 for example.

Comments (4)

  1. Thomas Mortagne reporter

    What do you think would be the cleanest for me to make sure to not fail when the lexer send me token not supported by the style ?

  2. Thomas Mortagne reporter

    Found a workaround (I think) in other formatters actually:

    while ttype not in self.styles:
      ttype = ttype.parent
    
  3. Log in to comment