3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ sourceUnitObject.imports # []
67
67
sourceUnitObject.pragmas # []
68
68
sourceUnitObject.contracts.keys() # get all contract names
69
69
sourceUnitObject.contracts[" contractName" ].functions.keys() # get all functions in contract: "contractName"
70
+ sourceUnitObject.contracts[" contractName" ].functions[" myFunction" ].visibility # get "myFunction"s visibility (or stateMutability)
70
71
```
71
72
72
73
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def read(fname):
18
18
return open (os .path .join (os .path .dirname (__file__ ), fname )).read ()
19
19
20
20
21
- version = "0.0.4 "
21
+ version = "0.0.5 "
22
22
name = "solidity-parser"
23
23
24
24
setup (
Original file line number Diff line number Diff line change 9
9
if not len (sys .argv )> 2 or sys .argv [1 ] not in ("parse" ,"outline" ):
10
10
print ("\n - missing subcommand or path to solidity file.\n " )
11
11
print ("#> python -m solidity_parser <subcommand> <solidity file>" )
12
+ print ("" )
13
+ print ("\t subcommands:" )
14
+ print ("\t \t parse ... print the parsetree for the sourceUnit" )
15
+ print ("\t \t outline ... print a high level outline of the sourceUnit" )
12
16
sys .exit (1 )
13
17
14
18
node = parser .parse_file (sys .argv [2 ])
0 commit comments