Comments (9)
Hey @jjlauer
I had other things to do past month, but at last I had the time to deal with this. I just created a pull request to resolve this enhancement.
See the request for all the details, in short it uses the normal comma and no escapes are necessary.
Could you merge it in and release the version later on?
Thanks!
from rocker.
from rocker.
Ok, that felt like the better option to me as well. Going to pick this one up then. :)
from rocker.
Hey @jjlauer,
While working on some tests for the with block, I encountered the following:
@with(String s = s.get(0)) {
@s
}
else {
// it will never get here, but the else is allowed here
}
The above is currently allowed already, though the else will never be executed since this is not a null-safe block (it is a bit like dead code).
This may be a bug, and it may be nice to actually have it fail, so users do get an error about it.
I can fix this alongside this enhancement if you want, to allow the else only for a null-safe with block. I intend to forbid it already for the multiple arguments one anyway.
What has your preference?
from rocker.
from rocker.
Hey @jjlauer,
All right.
How do we want to escape the comma, as it can easily be used in the expressions e.g.
@with (List<String> subs = strings.sublist(1\,2), List<String> anotherSub=strings.subList(0\,1).subList(0\,1), String t = "hello\, world") {
}
In the above example I escaped the relevant ones with a single back slash, I guess that would be my preference. What do you think?
from rocker.
from rocker.
Semicolon would not really work either, since it can be used inside a String (see above).
I'll think about it for now on how to deal with it. If I get the comma working I prefer that over something else. If not then we can do something else.
from rocker.
Thanks for applying the pull request and releasing @jjlauer!
I will close this issue then. :)
from rocker.
Related Issues (20)
- rocker-compiler.conf is in incorrect folder HOT 1
- Centralized conditional RockerContent rendering ? HOT 2
- Document required template extensions
- GraalVM compatibility HOT 4
- Warnings in Gradle Plugin (@Input annotation used on property of type 'File') HOT 6
- call java function in template HOT 1
- rocker-maven-plugin templateDirectory
- With block invalid: multiple equals symbols found for assignment String href = "/abc?x=y"
- [Doc] it's unclear how to instantiate Rocker
- Loading templates from classpath / jar ? HOT 1
- Parentheses right after variable HOT 2
- Compile time include postprocessor
- support Java 11 HOT 1
- Github latest release points to outdated release.
- Unable to get hot-reload working with tomcat server HOT 3
- Question about formatting
- Generation crashes with NPE if a non-normal file is present in the template directory HOT 1
- Global default null value rendering to avoid NPEs
- it's abandoned? HOT 1
- How to configure Rocker to use GuavaHtmlStringify? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocker.