On 5/5/06, Max Cantor <[EMAIL PROTECTED]> 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=/"/
   ... [EMAIL PROTECTED]"@ [EMAIL PROTECTED]|\\"@ 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;
   :[EMAIL PROTECTED]@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

Reply via email to