ollym / parrot

A lightning fast and lightweight templating engine for Node.js
38 stars 7 forks source link

Partial For statement erroring #4

Closed qrpike closed 11 years ago

qrpike commented 12 years ago

Hey, Im LOVING this library and using it on my newest project.

It works if I do for example: <%=variable%>

If I do this:

<% for(var i = 0; i < 3; i++) { %>

I am div #<% print(i) %>

<% } %>

It breaks with:

SyntaxError: Unexpected identifier at Object.render (/node.js/node_modules/parrot/index.js:165:9) at /node.js/sql.js:54:14 at [object Object]. (fs.js:107:5) at [object Object].emit (events.js:61:17) at afterRead (fs.js:878:12) at wrapper (fs.js:245:17)

e2b commented 11 years ago

The problem likely was the missing semicolon after print(i) since parrot didn't support ASI (JavaScript’s Automatic Semicolon Insertion). This is fixed in #8.