Comments (3)
Yes, this is the unfortunate result of trying to build an AST using tolerant mode. If the toleration extends beyond simple things like missing a semicolon into full parts of the tree missing (like the identifier with the contract name in this case) then we have to guard against that everywhere.
We should check if this is only a problem in the places where we are accessing getText() or requires a much bigger refactoring to handle every possible subnode not existing.
from solidity-parser-antlr.
I just wrapped all calls to getText with a function that handles nulls, that should solve your error and several others. Leaving this open to investigate if there are similar issues triggered by more obscure syntax errors.
from solidity-parser-antlr.
Thanks for the quick answer and fix fede 🙌🏻
I'll get back to this issue if I find this problem in other cases.
from solidity-parser-antlr.
Related Issues (20)
- Cannot get parsed ast correctly in production HOT 4
- Failing to parse abstract contracts in Solidity 0.6
- ANTLR grammar in the Solidity repository HOT 1
- Augment the `Parameter` type HOT 2
- Drop ParameterList and Parameter node types HOT 2
- docs: document the loc attribute
- Parse error when using underscores in numbers HOT 6
- Can't read property expressionList of null HOT 1
- Natspec feature throwing errors in natspec not attached to functions HOT 9
- Support inheritance specifier with optional arguments HOT 1
- `UnaryOperation` expression type missing from type definitions HOT 1
- `NewExpression` expression type missing from type definitions
- Parses error with arrays with ABIEncoderV2 HOT 3
- feat(visitor): support early termination
- Non-ascii characters corrupt the range data HOT 4
- Some bugs HOT 3
- Tokenize function is not working
- `parse` fails to parse empty files with `{ loc: true }` option
- solc 0.6.0 array slicing syntax for calldata arrays does not compile HOT 1
- 0.6.0: Support try/catch syntax 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 solidity-parser-antlr.