Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Loop Jade #45

Open
timrijckaert opened this issue Sep 17, 2016 · 0 comments
Open

For Loop Jade #45

timrijckaert opened this issue Sep 17, 2016 · 0 comments

Comments

@timrijckaert
Copy link

timrijckaert commented Sep 17, 2016

Hi

I noticed the for loop doesn't seem to be working.
When the following code is run
(as seen on CodePen)

body
    - for (var x = 1; x < 16; x++)
    .div= x

I get :

Uncaught Exception ::unable to evaluate [for (var x = 1; x < 16; x++)] - Parsing de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression@1:12 parsing error near '... r x = 1; x ...'
class de.neuland.jade4j.exceptions.JadeCompilerException dashboard-android:31
unable to evaluate [for (var x = 1; x < 16; x++)] - Parsing de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression@1:12 parsing error near '... r x = 1; x ...'
    at de.neuland.jade4j.parser.node.ExpressionNode.execute(ExpressionNode.java:46)
    at de.neuland.jade4j.parser.node.BlockNode.execute(BlockNode.java:16)
    at de.neuland.jade4j.parser.node.TagNode.execute(TagNode.java:73)
    at de.neuland.jade4j.parser.node.BlockNode.execute(BlockNode.java:16)
    at de.neuland.jade4j.parser.node.TagNode.execute(TagNode.java:73)
    at de.neuland.jade4j.parser.node.BlockNode.execute(BlockNode.java:16)
    at de.neuland.jade4j.compiler.Compiler.compile(Compiler.java:30)
    at de.neuland.jade4j.template.JadeTemplate.process(JadeTemplate.java:23)
    at de.neuland.jade4j.JadeConfiguration.renderTemplate(JadeConfiguration.java:71)
    at de.neuland.jade4j.JadeConfiguration.renderTemplate(JadeConfiguration.java:76)
    at spark.template.jade.JadeTemplateEngine.render(JadeTemplateEngine.java:78)
    at spark.TemplateViewRouteImpl$1.render(TemplateViewRouteImpl.java:61)
    at spark.TemplateViewRouteImpl$1.render(TemplateViewRouteImpl.java:58)
    at spark.TemplateViewRouteImpl.render(TemplateViewRouteImpl.java:85)
    at spark.http.matching.Routes.execute(Routes.java:62)
    at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:126)
    at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
    at org.eclipse.jetty.server.Server.handle(Server.java:517)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)
Caused by: de.neuland.jade4j.exceptions.ExpressionException: unable to evaluate [for (var x = 1; x < 16; x++)] - Parsing de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression@1:12 parsing error near '... r x = 1; x ...'
    at de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression(ExpressionHandler.java:31)
    at de.neuland.jade4j.expression.ExpressionHandler.evaluateStringExpression(ExpressionHandler.java:36)
    at de.neuland.jade4j.parser.node.ExpressionNode.execute(ExpressionNode.java:28)
    ... 30 more
Caused by: org.apache.commons.jexl2.JexlException$Parsing: de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression@1:12 parsing error near '... r x = 1; x ...'
    at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:1260)
    at org.apache.commons.jexl2.JexlEngine.createExpression(JexlEngine.java:435)
    at org.apache.commons.jexl2.JexlEngine.createExpression(JexlEngine.java:419)
    at de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression(ExpressionHandler.java:28)
    ... 32 more
Caused by: org.apache.commons.jexl2.parser.ParseException: parse error
    at org.apache.commons.jexl2.parser.Parser.generateParseException(Parser.java:3935)
    at org.apache.commons.jexl2.parser.Parser.jj_consume_token(Parser.java:3817)
    at org.apache.commons.jexl2.parser.Parser.ForeachStatement(Parser.java:374)
    at org.apache.commons.jexl2.parser.Parser.Statement(Parser.java:118)
    at org.apache.commons.jexl2.parser.Parser.JexlScript(Parser.java:72)
    at org.apache.commons.jexl2.parser.Parser.parse(Parser.java:24)
    at org.apache.commons.jexl2.JexlEngine.parse(JexlEngine.java:1248)
    ... 35 more
[qtp1021830707-16] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - >>> Spark shutting down ...
[qtp1021830707-16] INFO org.eclipse.jetty.server.ServerConnector - Stopped ServerConnector@2020264c{HTTP/1.1,[http/1.1]}{0.0.0.0:4567}
[qtp1021830707-16] ERROR spark.embeddedserver.jetty.EmbeddedJettyServer - stop failed
java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at java.lang.Thread.join(Thread.java:1253)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.doStop(QueuedThreadPool.java:161)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:143)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:161)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:73)
    at org.eclipse.jetty.server.Server.doStop(Server.java:476)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
    at spark.embeddedserver.jetty.EmbeddedJettyServer.extinguish(EmbeddedJettyServer.java:145)
    at spark.Service.stop(Service.java:309)
    at spark.Spark.stop(Spark.java:1004)
    at mycode.packageName.SparkImpl
    at spark.Service$1.handle(Service.java:386)
    at spark.http.matching.GeneralError.modify(GeneralError.java:43)
    at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:135)
    at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
    at org.eclipse.jetty.server.Server.handle(Server.java:517)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant