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

Qute If section - fix evaluation of composite params with a logical complement operator #22181

Merged
merged 1 commit into from Dec 14, 2021

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Dec 14, 2021

..a logical complement operator

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 14, 2021

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should not end up with dot

This message is automatically generated by a bot.

@mkouba mkouba added this to the 2.7 - main milestone Dec 14, 2021
@mkouba mkouba added triage/backport? area/qute The template engine labels Dec 14, 2021
@mkouba
Copy link
Contributor Author

mkouba commented Dec 14, 2021

@gsmet I believe that this one should go into 2.6.0.Final.

Copy link
Member

@FroMage FroMage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve this, but I have to tell you that normally it's the parser's job to decide on priorities, by constructing the parsed tree using operator precedence.

Perhaps we should spend a bit of time together trying to use an ANTLR parser for Qute in the future?

@mkouba
Copy link
Contributor Author

mkouba commented Dec 14, 2021

I'll approve this, but I have to tell you that normally it's the parser's job to decide on priorities, by constructing the parsed tree using operator precedence.

Ofc, the problem here is that the sections params are not designed as proper language constructs. It would make sense for {#if} but not for other sections. Qute was originally designed as logic-less templating but then we had to relax some of the rules to be more practical ({#if} is one of the example). So there is a mismatch and we need to find a reasonable compromise ;-).

Perhaps we should spend a bit of time together trying to use an ANTLR parser for Qute in the future?

@angelozerr is working on this within the quarkus-ls project. See also redhat-developer/quarkus-ls#473.

@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 14, 2021
@angelozerr
Copy link

Perhaps we should spend a bit of time together trying to use an ANTLR parser for Qute in the future?

ANTLR is very powerfull but when you try to use it in an IDE/Editor you can have some trouble because even if it can manage fault tolerant (broken Qute template), it's hard for IDE/Editor to detect properly the error ranges that we need in an IDE/Editor.

More ANTLR parser stores a lot of infirmation for line, offset etc. In an IDE/Editor we need to take care of memory. That's why I implemented a Qute parser at hand.

Today my parser is linked with some information that I need (like QuteProject) but I'm sure that I can clean it and use it for Qute core. Having the same parser for the core and for IDE/Editor integration should b ereally nice. For instance IDE/Editor could pick up the Qute Jar of the project (with a given maven dependency) and user will have the same error in the editor than the Qute mavendependency that it consumes.

@quarkus-bot
Copy link

quarkus-bot bot commented Dec 14, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 9710961

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
✔️ JVM Tests - JDK 17

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 #

- Failing: integration-tests/kafka-devservices 

📦 integration-tests/kafka-devservices

io.quarkus.it.kafka.KafkaAdminTest.health - More details - Source on GitHub

java.lang.RuntimeException: 
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kafka.client.deployment.DevServicesKafkaProcessor#startKafkaDevService threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed

@gsmet gsmet changed the title Qute If section - fix evaluation of composite params with.. Qute If section - fix evaluation of composite params with a logical complement operator Dec 14, 2021
@gsmet gsmet merged commit 22ddc60 into quarkusio:main Dec 14, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 14, 2021
@gsmet gsmet modified the milestones: 2.7 - main, 2.6.0.Final Dec 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qute: bug in if test
4 participants