Comments (4)
Yes, that's expected:
($x) a;
corresponds to a statement consisting of only a cast($x) a
corresponds to a cast, no matter where it is found.
from gritql.
This is to be expected, since the ;
is not part of the cast, but instead is part of the outer statement.
from gritql.
I have updated the studio link with this:
class Bar {
void main() {
(string) a;
long a = (string) a;
}
}
This pattern matches only the first cast. (string) a;
`($x) a;` => `(long) a;`
but this pattern matches both casts. (string) a;
and long a = (string) a;
`($x) a` => `(long) a`
Is this expected behavor?
from gritql.
ok, thanks for the clarification, I had this same issue with the php language, looks like it's working as expected.
from gritql.
Related Issues (20)
- Query for code inside markdown files
- Yaml auto-indentation does not behave as expected HOT 1
- Creating a PR is broken from studio
- TypeScript AST improvement HOT 1
- grit apply 'constructor(){} => .' still matches empty constructors with parameters HOT 2
- Document and sync rule spec
- Document insert operator
- Prepend operator
- Bug: orphaned node cleaner for function bodies
- Document `if` clause HOT 1
- NPM Package for gritql HOT 2
- Flow grammar HOT 2
- @getgrit/bridge is missing from npm HOT 2
- bug: node cleaner for function bodies (cont. #209) HOT 1
- Feature request: ability to specify number of lines before & after matches for context
- Rust suppression failing
- Improve path normalization in snapshots
- Python indentation issue - error HOT 1
- Feature request: re-use `$...` meta variable in rewrite expression 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 gritql.