Comments (6)
Thank you! I reproduced the bug! I'll take a look at it.
from twigcs.
I forgot to mention that I'm running the commit 80d4f9a, the version v4.0-BETA3
from twigcs.
I'm not able to reproduce by only using {% block myblock 'foo' ~ (mycondition ? 'bar' : 'baz') %}
in a template. Can you provide me a small snippet that triggers it if used as is?
from twigcs.
Here the exact code structure:
{% block block_name 'some-text' ~ (not a_function() ? ' other other-text-2') %}
from twigcs.
@OwlyCode do you have any news about this bug ?
from twigcs.
@stof It looks like it's a problem inside ScopedExpression where the parentheses are wrongly associated, resulting in a broken tree:
> ./bin/twigcs-debug reg:deb test.html.twig
Expr
====
{% block block_name 'some-text' ~ (not a_function() ? ' other other-text-2') %}
Sanitized expr
==============
{% block block_name 'AAAAAAAAA' ~ (not a_function() ? 'AAAAAAAAAAAAAAAAAAA') %}
Extracted node tree
===================
↪ {% block block_name 'AAAAAAAAA' ~ __PARENTHESES__ (offset: 0, type: expr)
↪ (not a_function__PARENTHESES__ ? 'AAAAAAAAAAAAAAAAAAA') %} (offset: 34, type: expr)
↪ () (offset: 49, type: expr)
But sadly I have not started working on the fix yet.
from twigcs.
Related Issues (20)
- Ability to exclude files (not only dirs) and/or limit sniffing to git diff HOT 1
- Please publish the new release (for symfony 6 use) HOT 2
- Problem when multiple lines HOT 7
- Invalid version value HOT 1
- Support request: How to disable verification of a code fragment? HOT 2
- Support config files with `.php` extension HOT 1
- Spacing of default values in macros HOT 2
- SEVERITY_IGNORE not working
- RegEngine is not happy with breaklines
- Unused variable should not be trigger if the child mutate a parent's variable. HOT 1
- Support for ??? "Empty Coalesce" operator HOT 1
- Variables set and used in loop should not be marked as unused HOT 2
- PHP 8.2 deprecations
- Supporting `createTemplate()`
- Configure cache file location HOT 2
- Avoid useless whitespace control
- Detect Twig depreciations
- PHP 8.3 support HOT 3
- [IMPORTANT] Future of the library HOT 3
- Release for the PHP 8.3 support HOT 2
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 twigcs.