Comments (6)
The parser doesn't make bar a child of a conditional declaration. It parses "version(Windows):" as a sibling node to bar.
from libdparse.
Are you saying this is expected? If I simply take out the nested version(X86_64)
block in the second file, Dscanner can't find bar
, ie it is a child again.
from libdparse.
Like this?
version(Windows):
long bar = 3;
from libdparse.
Yes, or this:
version(Windows):
char noo = 'd';
long bar = 3;
Note that is with the one modification to Dscannner specified above, to omit visiting conditional declarations. Try it for yourself, add that line and recompile Dscanner, then try searching each of the above sample files. It's not clear why bar
is a child declaration within a colon-terminated conditional declaration in some cases but not in others, ie when there's a nested conditional declaration in between.
from libdparse.
Have you tried the --ast
option? It should show you what AST the parser is creating.
from libdparse.
No, I had not tried it. It shows that noo
and bar
are listed in the trueDeclarations
for the first Windows
conditional declaration if there's no nested conditional declaration, but not if the X86_64
conditional declaration is in between. They are then listed outside the Windows
conditional declaration, which appears to be a clear bug to me, as a colon-terminated version declaration should apply to the entire file.
from libdparse.
Related Issues (20)
- Parses Ddoc file but shouldn't HOT 1
- Libdparse parseModule reentrant HOT 6
- Program exited with code -11 on not Windows and ldc-1.29.0 HOT 3
- bounds violation in `parsePragmaStatement` HOT 1
- `parseModule` overload set should take the parser type as template parameter HOT 1
- Outdated gramar HOT 2
- Add support for bitfields HOT 3
- Support scope for variable declaration in foreach statement HOT 1
- libdparse.dlang.io down HOT 1
- Which documentation generator to use?
- Add support for auto ref lambdas
- wrong version into meson build file HOT 2
- Fix multi-array parsing HOT 1
- Incomplete UnaryExpression for AutoDeclaration HOT 2
- Lidbparse does not implement multiple messages for static assert
- valid syntax isn't parsed correctly
- declaration in scope (exit) causes a parse error, but is valid D code HOT 2
- use structs in callbacks instead of many parameters
- Add support for: `alias this = _base;`
- Support delclarations in switch statements `switch(auto x = expr)`
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 libdparse.