(minor bug) parenthesis in text #72

Closed
Hendrik opened this Issue Sep 11, 2010 · 7 comments

Projects

None yet

4 participants

@Hendrik
Hendrik commented Sep 11, 2010

Using this

option(value='') -- (optional) Predefined services --

will result in a 'SyntaxError: Unexpected token )' error.

Escaping the ( ) also results in an error.

@caerphoto

I've encountered this, too. For now I've worked around it by using [ ] instead of ( ) in my text

@weepy
weepy commented Oct 4, 2010

Could you

  1. pull out the attributes pre lexing, using a simple state machine and counting the brackets.

  2. Revert to using colons instead of equals

  3. Treat the inner attribute part as Javascript which is evaluated in the appropriate context. The resultant object is then enumerated.

E.g.

option(value: myVal({a:1}) )

=> attributes = eval( "{" + "value: myVal({a:1})" +"}");
=> for(i in attributes) ....

@tj
Collaborator
tj commented Oct 4, 2010

that is what I did with haml I believe, but its a bit more complicated in jade. and this bug here has nothing to do with attributes, we just need a context, because technically right now below would keep trying to parse attributes

input(type: 'text')(checked)(id='foo')
@weepy
weepy commented Oct 5, 2010

sorry - i don't quite understand. Are you saying that jade wants to support multiple sets of attributes ? (seems unnecessary if so ?)

@tj
Collaborator
tj commented Oct 5, 2010

it wont work because I only check for attrs once, but the lexer continues to chomp away at "(" as if it were an attribute token

@tj
Collaborator
tj commented Oct 30, 2010

wow, ok. haha I will fix this soon, I rarely use jade since im always working on.. jade, and other framework/libraries, haha so now that im actually building a few little apps, i realize how annoying this bug is

@tj
Collaborator
tj commented Dec 9, 2010

Added test showing #72 is ok. Closed by 372de2a

seems fine

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment