Neville Franks schrieb:
> Hi, I working on syntax highlighting for ED4W and have problem with <<
> because it has three uses.
> 
> 1. << operator
> 2. << HERE Doc
> 3. class << Name  - Singleton Class
> 
> The problem is determining if << starts a Here Doc. It is easy to handle
> class<<Name is this regard, but I can't see how you can work out << in
> the following:
> 
>    Ared = "mary"
>    angy = "bill"
>    angy <<Ared      # does this start a Here Doc or is it operator <<
>    print <<Ared     # as above.
> 
> Thanks.
> 
> ---
> Neville Franks, http://www.getsoft.com http://www.surfulater.com
> 
Ooops! - I Think Ruby itself has some problems with it:

irb(main):001:0> Ared = "mary"
=> "mary"
irb(main):002:0> angy = "bill"
=> "bill"
irb(main):003:0> angy <<Ared
irb(main):004:0" Ared
=> "mary"
irb(main):005:0> angy
=> "billmary"
irb(main):006:0> angy << Ared
=> "billmarymary"
irb(main):007:0> angy <<EOT
irb(main):008:0" xxxxx
irb(main):009:0" EOT
NameError: uninitialized constant EOT
         from (irb):7
irb(main):010:0> angy
=> "billmarymary"
irb(main):011:0> angy << EOT
NameError: uninitialized constant EOT
         from (irb):11

Wolfgang NĂ¡dasi-Donner