Comments (3)
Works like a charm for me! Thx!!
from solidity-parser-antlr.
I also found this problem.
Given the code:
contract MyContract {
address public myAddress1;
address[] public myAddress2;
}
the parser generates:
{
"type": "SourceUnit",
"children": [
{
"type": "ContractDefinition",
"name": "MyContract",
"baseContracts": [],
"subNodes": [
{
"type": "StateVariableDeclaration",
"variables": [
{
"type": "VariableDeclaration",
"typeName": {
"type": "ElementaryTypeName",
"name": "address",
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 4
}
}
},
"name": "myAddress1",
"expression": null,
"visibility": "public",
"isStateVar": true,
"isDeclaredConst": false,
"isIndexed": false,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 19
}
}
}
],
"initialValue": null,
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 29
}
}
},
{
"type": "StateVariableDeclaration",
"variables": [
{
"type": "VariableDeclaration",
"typeName": {
"type": "ElementaryTypeName",
"name": "address",
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 12
}
}
},
"name": "myAddress2",
"expression": null,
"visibility": "public",
"isStateVar": true,
"isDeclaredConst": false,
"isIndexed": false,
"loc": {
"start": {
"line": 3,
"column": 21
},
"end": {
"line": 3,
"column": 21
}
}
}
],
"initialValue": null,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 31
}
}
}
],
"kind": "contract",
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 0
}
}
}
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 0
}
}
}
The type of myAddress2 should not be ElementaryTypeName.
from solidity-parser-antlr.
Thanks! This should be fixed in latest master. Can you try the changes and let me know if there is anything wrong?
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.