Obscure bug (I think)

1 view
Skip to first unread message

cameron

unread,
Dec 26, 2006, 10:51:56 AM12/26/06
to Haml
Hey Hampton, and everybody else,

Thanks for version 1.0...a good number to reach! Unfortunately I've hit
a little problem, which I'll describe here:

I upgraded our app from HAML 0.4 to 1.0 and I was getting a failing
test on one view. After a bunch of debugging to try to narrow down the
issue, it seems to be related to having a line with blank spaces on it,
and nothing else, just before a "silent script" block

eg. This fails:

<pre>
= @user
(2 or more spaces here)
- hello = @user
</pre>

But if I remove the 2 (or more) spaces I mention, it works. @user is a
defined variable, but I can do anything on those lines, not just
@user...it seems to be the 2+ spaces that are causing the problem.

The failure message is:

<pre>
(eval):11:in `compile': compile error
(eval):11: parse error, unexpected kEND, expecting $
Extracted source (around line #3):

1: = @user
2:
3: - hello = @user
</pre>

Just passing it on.....if you like I could look into your test suite
and work to make a failing test. Not sure if I'd be able to actually
fix it yet...but could try if needed

Cheers, and happy holidays!

Cameron

Nex3

unread,
Dec 26, 2006, 12:04:18 PM12/26/06
to ha...@googlegroups.com
I believe the issue here is that you have more whitespace in the empty
line after "= @user" than there is before "= @user". This is making Haml
think that you want to start a Ruby block, which screws everything up. A
quick fix for this would be to get rid of any spaces in the empty line.

This is a bug, though; empty lines should be completely ignored. I've
fixed this, and uploaded version 1.0.1 - it should be available via Gems
in an hour or so.

Thanks for pointing this out,
- Nathan

Reply all
Reply to author
Forward
0 new messages