Export to GitHub

spitfire - issue #2

Spitfire chokes on '))}'


Posted on Aug 12, 2009 by Swift Kangaroo

1.) Create a spitfire file with the following content:

def foo($s)

$s

end def

def bar($s)

$s

end def

<script type="text/javascript"> var bar={ cat: $foo($bar("dog")) }; </script>

2.) Run SpitFire on it.

It produces the following error: Trying to find START_PLACEHOLDER on line 11: > var bar={ cat: $foo($bar("dog")) }; > ^ List of nearby tokens: (@106) PLACEHOLDER_OPEN_PAREN = u'(' (@107) START_PLACEHOLDER = u'$' (@108) ID = u'bar' (@111) PLACEHOLDER_OPEN_PAREN = u'(' (@112) '"' = u'"' (@113) DOUBLE_QUOTE_STR = u'dog' (@116) '"' = u'"' (@117) CLOSE_PAREN = u')' (@118) CLOSE_PAREN = u')' (@119) PLACEHOLDER_CLOSE_BRACE = u' }'

3.) I expect it to produce the following: <script type="text/javascript"> var bar={ cat: "dog" }; </script>

Comment #1

Posted on Aug 12, 2009 by Quick Lion

The syntax here is a little ambiguous because braces are optional when using $placeholder.

If you use ${placeholder} around the expression, everything will work correctly.

In this case:

var bar={ cat: ${foo($bar("dog"))} };

Status: WontFix

Labels:
Type-Defect Priority-Medium