Menu

#21 More triple quoting brokenness

open
nobody
None
5
2004-09-09
2004-09-09
No

Is this related to the reason why all highlighting
after a line like the following line is broken?

print """')";"""

(btw, edloper, couldn't get your patch to go, but i'm
an emacs newbie so quite likely my fault)

Discussion

  • Alejandro Dubrovsky

    Logged In: YES
    user_id=12623

    That was meant to be a comment on the previous triple
    comment thread

     
  • Edward Loper

    Edward Loper - 2004-09-09
    • summary: More triple commenting brokenness --> More triple quoting brokenness
     
  • Edward Loper

    Edward Loper - 2004-09-09

    Logged In: YES
    user_id=195958

    Yes, this patch [#1023335] should fix that problem.

    As to having trouble getting my patch to work:

    - Did you apply it against rev 4.62 (the revision
    in python-mode cvs, not the one under files or
    included with python's cvs)

    - I'm not exactly an elisp guru, so it's not
    necessarily your fault -- there could be a bug
    in my code. :)

    - If you're still having trouble, please email me
    directly and I'll try to figure out what's wrong --
    I'm definitely interested in seeing if this works
    for other people. edloper at gradient dot cis
    dot upenn dot edu.

    For posterity, here's a more complete description of the problem:

    Currently, emacs mode has no special handling for triple quoted strings.
    So if a triple quoted string contains an unmatched (and non-
    backslashed) quote of the same type, then it's interpreted as a close
    quote, and the number of quote marks gets off by one, so the final quote
    of the triple quoted string is interpreted as an open quote.

    I.e., for this text:

    """ inside " outside """ inside

    The regions marked 'inside' are colored as quotes. The normal work-
    around is to backslash quotes in triple quoted strings, since a backslashed
    quote is just a quote:

    """ inside \" inside """ outside

    But this doesn't work for raw strings.

    The referenced patch adds explicit handling for triple quoted strings, and
    should solve these problems.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.