Loading ...
Sorry, an error occurred while loading the content.

Re: LiveJournal S2 Syntax Highlighting - Strings

Expand Messages
  • Yakov Lerner
    ... It s just equivalent to ... start=/L = / skip=/ | / end=/ / ... start=@L = @ skip=@ | @ end=@ @ ... start=;L = ; skip=; | ; end=; ; Any
    Message 1 of 2 , May 4, 2006
    • 0 Attachment
      On 5/5/06, Max Cantor <maxcantor@...> wrote:
      > S2 has a special type of string that is
      > delimited by three quotes, which allows you to include quotes and
      > double quotes in the string, unescaped. (This is useful for
      > quote-heavy stuff like HTML.) It looks like this:
      >
      > """this is a "cool string" in which quotes - "" need not be escaped"""
      >
      > Anyway, I'm trying to figure out how to fit this into my syntax
      > highlighting. I guess my biggest problem is that I do not understand
      > the canonical string region declaration; this one is from c.vim:
      >
      > syn region s2String start=+L\="+ skip=+\\\\\|\\"+ end=+"+
      >
      > What in the world do those pluses mean? And that queue of
      > backslashes? I don't understand how those specifications follow
      > pattern syntax.

      It's just equivalent to
      ... start=/L\="/ skip=/\\\\\|\\"/ end=/"/
      ... start=@L\="@ skip=@\\\\\|\\"@ end=@"@
      ... start=;L\="; skip=;\\\\\|\\"; end=;";
      Any delimiter can be used in place of '/' to delimit regexp!
      BTW it's also true about :s/// command; all of the following mean the same:
      :s;from;to;
      :s@from@to@
      :s+from+to+
      (except when separattor occurs inside the regexp and replacement).

      Backslashes mean to handle the "\n\\\"" C notation. Maybe you don't need it,
      depending of whether S2 handlesh backslas inside quoted sring
      specially or not.

      Yakov
    Your message has been successfully submitted and would be delivered to recipients shortly.