parser_node_ext 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -0
- data/lib/parser_node_ext/version.rb +1 -1
- data/lib/parser_node_ext.rb +1 -1
- metadata +3 -4
- data/sig/parser_node_ext.rbs +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5979c4347af5a58dd65ea5adde58dd875fc96c933d1e5170bdfea45c6e49b6b8
|
4
|
+
data.tar.gz: 7c5065270a2a3fe7507e2c3f3cafa9526c3cfd315e54108cd9f8438431728201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0fbd8b3e8e46cf1f764559cc915b1056a6c760cb7fe2c2a0a67c8f51314c914fcdc86a1f5ecba25c2ecb81df1d718ef2e61a7eb3c05c41b11e802c073130878
|
7
|
+
data.tar.gz: 83ffd74f90b673509ef42af75587bc8e9f4078903a02b9687ddba1c4f67917745d2d0ee4023e2676b578d34deae1a81b541f9de372416c27eb7cfc2c01dc5df6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
It assigns names to the child nodes of the [parser](https://rubygems.org/gems/parser).
|
4
4
|
|
5
|
+
```ruby
|
6
|
+
# node is a send node
|
7
|
+
node.receiver # get the receiver of node
|
8
|
+
node.message # get the message of node
|
9
|
+
node.arguments # get the arguments of node
|
10
|
+
```
|
11
|
+
|
5
12
|
It also adds some helpers
|
6
13
|
|
7
14
|
```ruby
|
data/lib/parser_node_ext.rb
CHANGED
@@ -437,7 +437,7 @@ module ParserNodeExt
|
|
437
437
|
|
438
438
|
# Convert node to a hash, so that it can be converted to a json.
|
439
439
|
def to_hash
|
440
|
-
result = {
|
440
|
+
result = { node_type: type }
|
441
441
|
if TYPE_CHILDREN[type]
|
442
442
|
TYPE_CHILDREN[type].each do |key|
|
443
443
|
value = send(key)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parser_node_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -41,7 +41,6 @@ files:
|
|
41
41
|
- lib/parser_node_ext.rb
|
42
42
|
- lib/parser_node_ext/version.rb
|
43
43
|
- parser_node_ext.gemspec
|
44
|
-
- sig/parser_node_ext.rbs
|
45
44
|
homepage: https://github.com/xinminlabs/parser_node_ext
|
46
45
|
licenses: []
|
47
46
|
metadata:
|
@@ -63,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
62
|
- !ruby/object:Gem::Version
|
64
63
|
version: '0'
|
65
64
|
requirements: []
|
66
|
-
rubygems_version: 3.4.
|
65
|
+
rubygems_version: 3.4.13
|
67
66
|
signing_key:
|
68
67
|
specification_version: 4
|
69
68
|
summary: extend parser node
|
data/sig/parser_node_ext.rbs
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
module ParserNodeExt
|
2
|
-
VERSION: String
|
3
|
-
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
4
|
-
|
5
|
-
def arguments: () -> Array[Parser::AST::Node]
|
6
|
-
def arguments_count: () -> Integer
|
7
|
-
def begin: () -> Parser::AST::Node
|
8
|
-
def body: () -> Array[Parser::AST::Node]
|
9
|
-
def caller: () -> Parser::AST::Node
|
10
|
-
def elements: () -> Array[Parser::AST::Node]
|
11
|
-
def else_statement: () -> Parser::AST::Node
|
12
|
-
def exceptions: () -> Array[Parser::AST::Node]
|
13
|
-
def end: () -> Parser::AST::Node
|
14
|
-
def ensure_body: () -> Array[Parser::AST::Node]
|
15
|
-
def expression: () -> Parser::AST::Node
|
16
|
-
def old_name: () -> Symbol
|
17
|
-
def options: () -> Parser::AST::Node
|
18
|
-
def operator: () -> Symbol
|
19
|
-
def if_statement: () -> Parser::AST::Node
|
20
|
-
def in_statements: () -> Array[Parser::AST::Node]
|
21
|
-
def key: () -> Parser::AST::Node
|
22
|
-
def guard: () -> Parser::AST::Node
|
23
|
-
def left_value: () -> Parser::AST::Node | Symbol
|
24
|
-
def message: () -> Symbol
|
25
|
-
def name: () -> Parser::AST::Node | Symbol
|
26
|
-
def new_name: () -> Symbol
|
27
|
-
def pairs: () -> Array[Parser::AST::Node]
|
28
|
-
def parent_class: () -> Parser::AST::Node
|
29
|
-
def receiver: () -> Parser::AST::Node
|
30
|
-
def rescue_bodies: () -> Array[Parser::AST::Node]
|
31
|
-
def right_value: () -> Parser::AST::Node
|
32
|
-
def self: () -> Parser::AST::Node
|
33
|
-
def value: () -> Parser::AST::Node
|
34
|
-
def variable: () -> Parser::AST::Node
|
35
|
-
def when_statements: () -> Array[Parser::AST::Node]
|
36
|
-
|
37
|
-
def to_hash: () -> Hash
|
38
|
-
end
|