On Jan 28, 9:01 pm, Neville Franks <s... / surfulater.com> wrote:
> Thanks to everyone for their replies. It looks like the only practical
> way for me handle this is to assume << is an operator if a space follows
> it, otherwise as a Here Doc.

FWIW, here's how I implemented it in the ruby mode for jEdit. It
recognizes the following as a here document:

1. The << characters, optionally followed by a - character, followed
by printable characters enclosed in single or double quotes. E.g.
  <<'hello'
  <<-'thingy67%'
  <<"foobar  $"
  <<-"boofar  @"

2. The << characters, optionally followed by a - character, followed
by letters and/or underscores.  E.g.
  <<Hello_there
  <<-Howdy

Looking at this now, that second case should probably have been
letters *and numbers* and underscores, but not starting with a number,
i.e. a valid identifier.