rbs-inline 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rbs/inline/parser.rb +1 -0
- data/lib/rbs/inline/version.rb +1 -1
- data/lib/rbs/inline/writer.rb +23 -1
- data/rbs_collection.lock.yaml +3 -3
- data/sig/generated/rbs/inline/writer.rbs +7 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f73d1f3ac7e111f773fe9b2d034dc5ccc3a8732f50aacf1a07655ad3450e24f4
|
4
|
+
data.tar.gz: '082c1f8a6ef85a239f29563f1e95d6af0ac0af89c5860a6c552d56505a0a27ba'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6002e610f1440abbfe351ee3c746e6c4c1f6dcae1a885fc9a5f60d701ebd0548620d8c6ffc6211bffd5830fd9c65901f7d7155d6de049a8670f0b72749f55b0c
|
7
|
+
data.tar.gz: 61041de88fbc0048f48fc46c012e1d1a7ff66760aef73e288f60351705425f466d84a4d50488feac54bb58e50fb504916596a8ceaf8ee5f99c76919227ee431e
|
data/README.md
CHANGED
data/lib/rbs/inline/parser.rb
CHANGED
data/lib/rbs/inline/version.rb
CHANGED
data/lib/rbs/inline/writer.rb
CHANGED
@@ -180,7 +180,7 @@ module RBS
|
|
180
180
|
|
181
181
|
rbs << RBS::AST::Declarations::Constant.new(
|
182
182
|
name: decl.constant_name,
|
183
|
-
type: decl
|
183
|
+
type: constant_decl_to_type(decl),
|
184
184
|
comment: comment,
|
185
185
|
location: nil
|
186
186
|
)
|
@@ -608,6 +608,28 @@ module RBS
|
|
608
608
|
comment: comment
|
609
609
|
)
|
610
610
|
end
|
611
|
+
|
612
|
+
# @rbs decl: AST::Declarations::ConstantDecl
|
613
|
+
# @rbs return: RBS::Types::t
|
614
|
+
def constant_decl_to_type(decl)
|
615
|
+
type = decl.type
|
616
|
+
return type unless type.is_a?(RBS::Types::ClassInstance)
|
617
|
+
return type if type.args.any?
|
618
|
+
|
619
|
+
case decl.node.value
|
620
|
+
when Prism::ArrayNode
|
621
|
+
RBS::BuiltinNames::Array.instance_type(untyped)
|
622
|
+
when Prism::HashNode
|
623
|
+
RBS::BuiltinNames::Hash.instance_type(untyped, untyped)
|
624
|
+
else
|
625
|
+
type
|
626
|
+
end
|
627
|
+
end
|
628
|
+
|
629
|
+
# @rbs return: RBS::Types::Bases::Any
|
630
|
+
def untyped
|
631
|
+
@untyped ||= RBS::Types::Bases::Any.new(location: nil)
|
632
|
+
end
|
611
633
|
end
|
612
634
|
end
|
613
635
|
end
|
data/rbs_collection.lock.yaml
CHANGED
@@ -34,7 +34,7 @@ gems:
|
|
34
34
|
source:
|
35
35
|
type: stdlib
|
36
36
|
- name: prism
|
37
|
-
version: 0.
|
37
|
+
version: 1.0.0
|
38
38
|
source:
|
39
39
|
type: rubygems
|
40
40
|
- name: rake
|
@@ -42,11 +42,11 @@ gems:
|
|
42
42
|
source:
|
43
43
|
type: git
|
44
44
|
name: ruby/gem_rbs_collection
|
45
|
-
revision:
|
45
|
+
revision: 25b8cf2135233e112d93d6b64083ee5e419875b6
|
46
46
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
47
47
|
repo_dir: gems
|
48
48
|
- name: rbs
|
49
|
-
version: 3.
|
49
|
+
version: 3.6.0
|
50
50
|
source:
|
51
51
|
type: rubygems
|
52
52
|
- name: rdoc
|
@@ -107,6 +107,13 @@ module RBS
|
|
107
107
|
# @rbs rbs: _Content
|
108
108
|
# @rbs return: void
|
109
109
|
def translate_class_block_decl: (AST::Declarations::BlockDecl block, _Content rbs) -> void
|
110
|
+
|
111
|
+
# @rbs decl: AST::Declarations::ConstantDecl
|
112
|
+
# @rbs return: RBS::Types::t
|
113
|
+
def constant_decl_to_type: (AST::Declarations::ConstantDecl decl) -> RBS::Types::t
|
114
|
+
|
115
|
+
# @rbs return: RBS::Types::Bases::Any
|
116
|
+
def untyped: () -> RBS::Types::Bases::Any
|
110
117
|
end
|
111
118
|
end
|
112
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs-inline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prism
|
@@ -34,14 +34,14 @@ dependencies:
|
|
34
34
|
name: rbs
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: 3.5.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - "
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 3.5.0
|
47
47
|
description: Inline RBS type declaration.
|