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

Unable to set variable to array #4

Open
jdreddaway opened this issue May 14, 2019 · 1 comment
Open

Unable to set variable to array #4

jdreddaway opened this issue May 14, 2019 · 1 comment

Comments

@jdreddaway
Copy link

See https://stackoverflow.com/questions/56138416/how-to-set-variable-to-array-in-velocity

I am trying to do the following:

#set ($my = "blah")
#set ($say = ["not", $my, "fault"])

But I get the following error:

error: An error occurred in the @AutoProtoModel processor while processing com.google.protobuf.contrib.autoprotomodel.prototype.AlbumModel:
  com.google.escapevelocity.ParseException: Expected an expression, on line 46, at text starting: ["not", $my, "fault"...
    com.google.escapevelocity.Parser.parseException(Parser.java:1093)
    com.google.escapevelocity.Parser.parsePrimary(Parser.java:923)
    com.google.escapevelocity.Parser.parseUnaryExpression(Parser.java:890)
    com.google.escapevelocity.Parser.parseExpression(Parser.java:797)
    com.google.escapevelocity.Parser.parseSet(Parser.java:401)
    com.google.escapevelocity.Parser.parseDirective(Parser.java:328)
    com.google.escapevelocity.Parser.parseNode(Parser.java:218)
    com.google.escapevelocity.Parser.parseTokens(Parser.java:126)
    com.google.escapevelocity.Parser.parse(Parser.java:118)
    com.google.escapevelocity.Template.parseFrom(Template.java:112)
    com.google.escapevelocity.Template.parseFrom(Template.java:94)
    com.google.protobuf.contrib.autoprotomodel.prototype.BackingClassGenerator.loadTemplate(BackingClassGenerator.java:97)
...
@eamonnmcmanus
Copy link
Member

Yes, array literals are not currently supported, though I have a prototype implementation that is not yet submitted.

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

2 participants