Handling lines [issue 5]

8 views
Skip to first unread message

Magnus Holm

unread,
Dec 21, 2009, 3:59:08 PM12/21/09
to guardians-o...@googlegroups.com
Ugh. Those damn \n. They seem to be pretty important though. It is
very nice to see:

NameError: undefined local variable or method `ohno' for main:Object
from cool.erb:5 (And the error actually is on line 5)

Of course, DynamicInliner will always mess up with line-numbers, but
that's always choice you'll have to make (performance vs.
friendliness). Nothing stops you from mixing between development and
production.

--

If Temple is going to support this, I want it right into core. I'm
thinking about this structure:

[:lines, array_of_code_on_line1, array_of_code_on_line2, …]

[:lines,
[[:dynamic, "@hello"], [:static, "world"]], # line 1
[[:static, "Merry Christmas everybody!"]]] # line 2

This could also replace :multi all together. Instead of [:multi,
code1, code2] you could simply write [:lines, [code1], [code2]].
Therefore it's important to fix this as soon as possible, so I don't
have to rewrite every little filter so many times.

Hm…

I'm not sure. Line-numbers are complex. Any ideas?


//Magnus Holm

Magnus Holm

unread,
Dec 21, 2009, 5:21:28 PM12/21/09
to Guardians of the Temple
Just pushed out a branch where I rewrote Core + StaticMerger to
use :lines. It was surprisingly easy:
http://github.com/judofyr/temple/commit/5db6f9e09813703d866e5660450ee1bb39514dde
Reply all
Reply to author
Forward
0 new messages