Evergreen comment highlighting confused by Ruby's #{} (1721/3258/1.6.0_13-b03/Linux 2.6.35.13-weta-20110808/amd64 x2)

5 views
Skip to first unread message

Chris Reece

unread,
Nov 10, 2011, 2:30:09 PM11/10/11
to evergre...@googlegroups.com
As in the attached image, Evergreen needs to distinguish between use of # to begin comments and use of #{} substitutions:

ehbdiadg.png

Elliott Hughes

unread,
Nov 10, 2011, 4:58:31 PM11/10/11
to evergre...@googlegroups.com
without really parsing Ruby, i wonder how well you can fix this. in
the screenshot you provide, iirc, the only reason we get the first #{}
right is that there's no space before the #. so if you wanted to
hard-code a belief that #{ is never a comment (even though, in theory,
it could be), there'd be no moral high ground for any opponent of such
a hack to take. (short of proffering a real Ruby parser.)

On Thu, Nov 10, 2011 at 11:30, Chris Reece <c...@jessies.org> wrote:
> As in the attached image, Evergreen needs to distinguish between use of # to begin comments and use of #{} substitutions:
>
>
>
>

> The first is not highlighted because of the adjacent, preceding '[' -- stick a space between them and it turns green.  Here's some test code demonstrating the %x, in case you're tempted to read incorrectness into its hideousness:
>
> $ irb
> ruby-1.9.2-p290 :001 > f='foo'
> => "foo"
> ruby-1.9.2-p290 :002 > b='bar'
> => "bar"
> ruby-1.9.2-p290 :003 > %x[echo #{f} #{b}]
> => "foo bar\n"
>
> I'll take a look through salma-hayek some time, when I get time, unless you want to fix this up first.
>
> --
> You received this message because you are subscribed to the Google Groups "evergreen-users" group.
> To post to this group, send email to evergre...@googlegroups.com.
> To unsubscribe from this group, send email to evergreen-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/evergreen-users?hl=en.
>
>
>

--
Elliott Hughes - http://www.jessies.org/~enh/

Reply all
Reply to author
Forward
0 new messages