Skip to content

Commit 49b6af0

Browse files
committed
renamed package to solidity_parser
added support for location
1 parent 9526ec9 commit 49b6af0

File tree

14 files changed

+193
-91
lines changed

14 files changed

+193
-91
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ A Solidity parser for Python built on top of a robust ANTLR4 grammar
66
## Install
77

88
```
9-
#> pip3 install solidity_parser_antlr
10-
#> python3 -m solidity_parser_antlry <path_to_contract.sol> # prettyprints tree
9+
#> pip3 install solidity_parser
10+
#> python3 -m solidity_parser <path_to_contract.sol> # prettyprints tree
1111
```
1212

1313
## HowTo
1414

1515
```python
1616

17-
from solidity_parser_antlr import parser
17+
import sys
1818
import pprint
1919

20+
from solidity_parser import parser
21+
2022
sourceUnit = parser.parse_file(sys.argv[1])
2123
pprint.pprint(sourceUnit)
2224
```
@@ -54,7 +56,7 @@ parse nodes can be accessed like dictionaries or object attributes. Nodes always
5456

5557
## Generate the parser
5658

57-
Update the grammar in `./solidity-antlr4/Solidity.g4` and run the antlr generator script to create the parser classes in `solidity_parser_antlr/solidity_antlr4`.
59+
Update the grammar in `./solidity-antlr4/Solidity.g4` and run the antlr generator script to create the parser classes in `solidity_parser/solidity_antlr4`.
5860
```
5961
#> bash script/antlr4.sh
6062
```

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def read(fname):
1111
setup(
1212
name="solidity-parser",
1313
version="0.0.1",
14-
packages=["solidity_parser_antlr"],
14+
packages=["solidity_parser"],
1515
author="tintinweb",
1616
author_email="tintinweb@oststrom.com",
1717
description=(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if __name__ == "__main__":
77
if not len(sys.argv)>1:
88
print("\n- missing path to solidity file.\n")
9-
print("#> python -m solidity_parser_antlr <solidity file>")
9+
print("#> python -m solidity_parser <solidity file>")
1010
sys.exit(1)
1111

1212
node = parser.parse_file(sys.argv[1])

0 commit comments

Comments
 (0)