question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing issue when having template files including interpolated strings

See original GitHub issue

Please try to g8 etorreborre/etorreborre/specs2-scala-2.10.g8.

You should have an error like:

action parse error; template context is [anonymous]
line 1:1: unexpected token: e1
    at org.antlr.stringtemplate.language.ActionParser.primaryExpr(ActionParser.java:813)
    at org.antlr.stringtemplate.language.ActionParser.expr(ActionParser.java:539)
    at org.antlr.stringtemplate.language.ActionParser.templatesExpr(ActionParser.java:222)
    at org.antlr.stringtemplate.language.ActionParser.action(ActionParser.java:126)
    at org.antlr.stringtemplate.StringTemplate.parseAction(StringTemplate.java:876)
    at org.antlr.stringtemplate.language.TemplateParser.action(TemplateParser.java:162)
    at org.antlr.stringtemplate.language.TemplateParser.template(TemplateParser.java:127)
    at org.antlr.stringtemplate.StringTemplate.breakTemplateIntoChunks(StringTemplate.java:850)
    at org.antlr.stringtemplate.StringTemplate.setTemplate(StringTemplate.java:441)
    at org.antlr.stringtemplate.StringTemplate.<init>(StringTemplate.java:308)
    at org.antlr.stringtemplate.StringTemplate.<init>(StringTemplate.java:293)
    at org.clapper.scalasti.adapter.ScalastiStringTemplate.<init>(ScalastiStringTemplate.java:57)
    at org.clapper.scalasti.StringTemplate.<init>(StringTemplate.scala:101)
...

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
argastcommented, Aug 21, 2015

You can use $"$"$ combination to work around this problem.

e.g. in Scala: s"$var" -> s"$"$"$var"

3reactions
laughedeliccommented, Jul 14, 2017

Escaping with \$ works for me with sbt 0.13.15 which should be using Giter8 0.7.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting a Parsing error on a template string with ESLint, but I ...
I know by default ESLint uses ECMAScript 5 (Specifying Parser Options) so I tried setting it to ECMA 6 (that has template strings...
Read more >
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >
String Interpolation in C# 10 and .NET 6
Format is called, it needs to parse the composite format string to find all the literal portions of the text, all of the...
Read more >
String Interpolation in JavaScript - Dmitri Pavlutin
In JavaScript, the template string implements the string interpolation. A template string is defined by wrapping a sequence of characters into ...
Read more >
Back to Basics: String Interpolation in C# - Rick Strahl's Web Log
Interpolated strings have to exist in their entirety at compile time as string literals, and all the expressions embedded in the string must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found