highlighting strings where the open and close quote marks...

highlighting strings where the open and close quote marks...

13
Basic UserBasic User
13

    Oct 06, 2005#1

    ...are different?
    Particularly PERL where the ~ character opens and closes a string quote, but is also involved in other functions, which don't want the same highlight applied.

    If there was some way to all for (say) qq~ as the opening quote marker, and ~; as the closing one, so that =~ isn't picked up in error - you get the idea?

    6,675585
    Grand MasterGrand Master
    6,675585

      Re: highlighting strings where the open and close quote mark

      Oct 06, 2005#2

      ~ in Perl is a string quote? That's new for me. But I'm no Perl expert, so maybe?

      Possible workaround according to your suggestion - add following to your Perl language definition line:

      Block Comment On Alt = qq~ Block Comment Off Alt = ~;

      Remove ~ from the String Chars = list and set the color of the alternative block comment to the color for strings.
      Best regards from an UC/UE/UES for Windows user from Austria

      119
      Power UserPower User
      119

        Re: highlighting strings where the open and close quote mark

        Oct 06, 2005#3

        Perl has an alternate quote syntax where pretty much anything can be a quote character. It's useful for avoiding "backslashitis" in situations where a string contains embedded quote characters, but it's hell on syntax highlighting.

        s_m_b, please chant the following mantra:
        Nothing but perl can parse Perl.
        Perl's syntax is much too flexible and context-sensitive for a general purpose editor to get the highlighting perfect. Even Perl-specific IDEs have their share of problems. UE can get most things right (with a little tweaking), but not everything. It's better to accept this than to fight it.

        Sometimes you can adjust your coding a little bit. e.g. use qq to turn single-quotes into double qoutes:

        Code: Select all

        qq'interpolated "$string" with embedded double quotes'
        Which works unless you embed both single and double quotes.

        236
        MasterMaster
        236

          Re: highlighting strings where the open and close quote mark

          Oct 10, 2005#4

          Didn't I read somewhere that Perl is the only language that looks the same before and after RSA encryption? :wink:

          SCNR,
          Tim (Python aficionado)