Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
geraldb committed Jan 29, 2023
1 parent dca16a1 commit 18472a6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# do NOT check in dev/test enviroment variables in .env (dot env files)
.env

.env.yml
.env.yaml

##
# ignore tmp directories
Expand Down
4 changes: 1 addition & 3 deletions solidity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ Get / generate outline from source in the solidity (`.sol`) contract programming
].each do |addr|

path = "awesome-contracts/address/#{addr}/contract.sol"
txt = read_text( path )

parser = Solidity::Parser.new( txt )
parser = Solidity::Parser.read( path )

puts "---"
puts "outline:"
Expand Down
9 changes: 8 additions & 1 deletion solidity/lib/solidity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
module Solidity

class Parser

def self.read( path )
txt = read_text( path )
new( txt )
end



def initialize( txt )
@txt = txt
end


SINGLE_COMMENT_RX = %r{^[ ]*//}
MULTI_COMMENT_BEGIN_RX = %r{^[ ]*/\*}
MULTI_COMMENT_END_RX = %r{\*/[ ]*$}
Expand Down
4 changes: 1 addition & 3 deletions solidity/sandbox/test_outline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
## addr = "0x031920cc2d9f5c10b444fd44009cd64f829e7be2"

path = "../../awesome-contracts/address/#{addr}/contract.sol"
txt = read_text( path )


parser = Solidity::Parser.new( txt )
parser = Solidity::Parser.read( path )
pp parser._quick_pass_one

puts "---"
Expand Down

0 comments on commit 18472a6

Please sign in to comment.