-
Notifications
You must be signed in to change notification settings - Fork 223
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
Parsing issue when having template files including interpolated strings #102
Comments
I'm having the same issue with a file that includes a regular expression involving a "$". I thought the $ could be escaped. Tried $ and $$ without success. |
My lousy workaround, until this is fixed, was to include this in the code: // This is to work around a parsing issue in giter8 - replace inlined dollar signs
val DOLLAR = (0x24).toChar And then: When("""^I retrieve the result""" + DOLLAR) { () => |
It also fails for an HTML file containing...
Even if written as:
Fortunately this time it was also possible to find a workaround:
though I would prefer the "$" form. |
I have another workaround. In the |
Did you test that? I just get an |
That was definitely working for me but I haven't tried recently. |
You can use e.g. in Scala: |
It gets quite ugly with javascript templates for AngularJs. As well as with Maven properties, checkstyle and scalastyle xmls. Parser should forward look for a complete Without a fix it looks like dollar was an unfortunate choice for escaping, instead of {{ }}, <% %>, whatever. Few places for placeholders but potentially many for dollars in different contexts. |
As well I would change title because it is more general problem than just with interpolated strings. |
I can change the behaviour of templating engine to fix this issue, but there
Personally I would prefer the second solution with optional escaping. |
With Pamflet I've always used |
|
The problem with escaping is that for example, I want to develop template separately. I create But if I want to write: package $package$
object Main extends App {
val foo = "foo"
val bar = "bar"
println(s"\$foo\$bar") // I need to escape this
} inner project won't work properly. Same thing with |
@foxmk I think that's a whole different issue from what's being reported here. Eric reported "action parse error; template context is [anonymous]". |
Hi, i was recently also trying to use giter8 to create a template which has amongst other things, sh files which would provide example commands to start docker containers with the right parameters, and therefore have a lot of env vars defined with |
|
I think #3 is the right solution:
It make no sense to pollute the whole source code with all kinds of escape while the ONLY replacements are limited to a very small set... This assumes that the file |
Escaping with |
FWIW: I'm having this problem with sbt 0.13.16 |
It seems like there was an identified correct solution (eg. if there is no token specified in build.properties, then dont try to find the closing dollar) is it a difficult change? and if so where would one look to make it? |
FWIW, I believe I'm seeing both |
It would be great to have a more intelligent behavior, like auto-escaping for undefined vars or when a closing $ sign is missing. |
I think that the verbatim could solve here. Since issue title is |
Please try to
g8 etorreborre/etorreborre/specs2-scala-2.10.g8
.You should have an error like:
The text was updated successfully, but these errors were encountered: