Menu

#1 Fix "infinite loops" in quote_highlight & comment_highlight

open
nobody
None
5
2004-12-07
2004-12-07
Juhika
No

Previously quotes that contained a comment token ex:
"//" or "/*" would result in the cbrowser front end
hanging. This was caused by some logic in
quote_highlight that tried to exluding using the quote
color highlighting for quoted strings in comments.

My approach to fixing this problem was to combine
quote_highlight and comment_highlight into one
function. This has the advangtage that we won't need
to check to see if a comment token in found within a
quoted string or visa versa. We should also see a
slight performance improvement in syntax highlighting
since we scan the file once less times.

Please follow up if there are any problems with this
patch since I can't test it with my current
installation of cbrowser since we have other
customization I don't think the general community would
be interested in. I've attempted to cut and paste the
relevent changes into a "clean" copy for ftcllib.tcl.

Discussion

  • Juhika

    Juhika - 2004-12-07

    ftcllib.tcl updated with new comment_quote_highlight function

     
  • Lluís Batlle i Rossell

    Logged In: YES
    user_id=264950

    It still doesn't work on "\\\\".

    I was writting the same patch today... It doesn't solve the
    "comments in quotes" part, but at least the program never
    hangs.

    I'll try to attach it, but I think in the future I'll try to
    improve your patch.

     

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.