solidity 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a34efb053c8fd9211832cedb2a99a05362f10fb3e43323d6bca7cd69783a88d
4
- data.tar.gz: 3e113d90344d4a4745836b3b8bea5f18f4ac3c621d56914e5610c331f25dba20
3
+ metadata.gz: 3920e32ab53156b256507811437d64f62f38bd42472aecb5c51a4fd3eb2f57e1
4
+ data.tar.gz: 4a5c36c583ba102881417af5d184c6351ef9d6a1f20154ab6096fb4722694bc6
5
5
  SHA512:
6
- metadata.gz: ea91690f94b665991f5f2e6934def21c1dd70ac475efc1e6cd578d84a05e31a7437dac0c1c3f9bffecb1283655ba3454d663f04a4ff190246ce240b4ea900535
7
- data.tar.gz: f8b3f08e0691d3cfc34b25ab6652a632f41df90a6d0d593f699971886301a329fcb4f6fac048d3d041432d446030b89338cf9cabd01239a00a4a69aa50de9c45
6
+ metadata.gz: b7227cdec56deceba0230c0f8946ea0182e2e144919bb2b0227d52a19c4085d89a0b2f3a62c796b162c9fba59880d5ee1cb154bfc0f5de1455cb4bd353d4602d
7
+ data.tar.gz: 9840c43aade93aaec0b0222c2db7dc4f50246565da9e52c69363fe599e43bed8e0e800ac31349a846ab7cfeb4e28126bde9fcfd8d6a85b884d9d26240b1fc35b
data/README.md CHANGED
@@ -55,7 +55,6 @@ Awesome Solidity @ <https://github.com/bkrem/awesome-solidity>
55
55
  ## Usage
56
56
 
57
57
  Get / generate outline from source in the solidity (`.sol`) contract programming language:
58
-
59
58
  ```ruby
60
59
  [
61
60
  "0x34625ecaa75c0ea33733a05c584f4cf112c10b6b",
@@ -92,6 +91,36 @@ library Base64
92
91
  ```
93
92
 
94
93
 
94
+ Note: The outline includes:
95
+
96
+ 1. contract definitions e.g.
97
+
98
+ contract NounsDescriptor is INounsDescriptor, Ownable
99
+
100
+ 2. abstract contract definitions e.g.
101
+
102
+ abstract contract Ownable is Context
103
+ abstract contract Context
104
+
105
+ 3. library definitions e.g.
106
+
107
+ library Strings
108
+ library NFTDescriptor
109
+ library MultiPartRLEToSVG
110
+ library Base64
111
+
112
+ 4. interface definitions e.g.
113
+
114
+ interface INounsDescriptor
115
+ interface INounsSeeder
116
+
117
+
118
+
119
+
120
+ <!-- break -->
121
+
122
+ More outline samples:
123
+
95
124
  ```
96
125
  outline:
97
126
  contract Indelible is ERC721A, ReentrancyGuard, Ownable
@@ -25,6 +25,22 @@ class Parser
25
25
 
26
26
  ## todo/fix - check if [^`] includes/matches newline too (yes)? -- add \n for multi-line!
27
27
 
28
+
29
+ ## from the solidity grammar
30
+ ##
31
+ ## StringLiteralFragment
32
+ ## : 'unicode'? '"' DoubleQuotedStringCharacter* '"'
33
+ ## | 'unicode'? '\'' SingleQuotedStringCharacter* '\'' ;
34
+ ##
35
+ ## fragment
36
+ ## DoubleQuotedStringCharacter
37
+ ## : ~["\r\n\\] | ('\\' .) ;
38
+ ##
39
+ ## fragment
40
+ ## SingleQuotedStringCharacter
41
+ ## : ~['\r\n\\] | ('\\' .) ;
42
+
43
+
28
44
  SINGLE_QUOTE = %r{'
29
45
  ( \\\\. | [^'] )*
30
46
  '}x
@@ -34,7 +50,25 @@ class Parser
34
50
  "}x
35
51
 
36
52
 
37
- NAME = /[a-zA-Z][a-zA-Z0-9_]*/
53
+ ## from the solidity grammar
54
+ ## > An identifier in solidity has to start with a letter,
55
+ ## > a dollar-sign or an underscore and
56
+ ## > may additionally contain numbers after the first symbol.
57
+ ##
58
+ ## Identifier
59
+ ## : IdentifierStart IdentifierPart* ;
60
+ ##
61
+ ## fragment
62
+ ## IdentifierStart
63
+ ## : [a-zA-Z$_] ;
64
+ ##
65
+ ## fragment
66
+ ## IdentifierPart
67
+ ## : [a-zA-Z0-9$_] ;
68
+
69
+ NAME = /[a-zA-Z$_][a-zA-Z0-9$_]*/
70
+
71
+
38
72
  END_OF_LINE = /\n|$/
39
73
  ## inline comments (multi- or end-of-line)
40
74
  END_OF_LINE_OR_COMMENT_OR_KEYWORD_OR_QUOTE = / \n
@@ -49,6 +83,16 @@ class Parser
49
83
  /x
50
84
 
51
85
 
86
+ ## from the solidity grammar
87
+ ##
88
+ ## COMMENT
89
+ ## : '/*' .*? '*/' ;
90
+ ##
91
+ ## LINE_COMMENT
92
+ ## : '//' ~[\r\n]* ;
93
+
94
+
95
+
52
96
  def _norm_whitespace( str )
53
97
  ## change newlines to spaces and
54
98
  ## all multiple spaces to one
@@ -106,7 +150,7 @@ class Parser
106
150
  ## print "abstract contract:"
107
151
  ## pp code
108
152
  tree << [:abstract_contract, code]
109
- when 'library'
153
+ when 'library'
110
154
  code = s.scan_until( /(?=\{)/ )
111
155
  code = _norm_whitespace( code )
112
156
  ## print "library:"
@@ -2,7 +2,7 @@
2
2
  module Solidity
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 3
5
+ PATCH = 4
6
6
  VERSION = [MAJOR,MINOR,PATCH].join('.')
7
7
 
8
8
  def self.version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer