decode 0.24.4 → 0.24.5
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/decode/location.rb +3 -0
- data/lib/decode/rbs/method.rb +4 -4
- data/lib/decode/rbs/type.rb +1 -0
- data/lib/decode/trie.rb +1 -1
- data/lib/decode/version.rb +1 -1
- data/sig/decode.rbs +3 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 403ad9626fb4852046e983a7d5c71d1edf6d5d1ab922b8872c46f3b856303291
|
4
|
+
data.tar.gz: ec06989a5e4081c1c23e2f6ed39049faaf449c866370496de19a35a31c1a703a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8f774f1f9ed21c1d985dc7124fbf2c5c6ea37b3502575186fcbbe6b406d0e62a6914a2c6929d72ef0ec258603b14146c71ac04e2867c3f2ed597f766dededc
|
7
|
+
data.tar.gz: be3291575b35ee43dc03a33a3f8e28f99ed3a792ec156d2a297a0956e00ae569217c5d8afe80f3c5f1bce1b77cc186fe317fdceda19a98d43ec72663014bebab
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/decode/location.rb
CHANGED
@@ -6,6 +6,9 @@
|
|
6
6
|
module Decode
|
7
7
|
# Represents a location in a source file.
|
8
8
|
class Location
|
9
|
+
# Initialize a new location.
|
10
|
+
# @parameter path [String] The path to the source file.
|
11
|
+
# @parameter line [Integer] The line number in the source file.
|
9
12
|
def initialize(path, line)
|
10
13
|
@path = path
|
11
14
|
@line = line
|
data/lib/decode/rbs/method.rb
CHANGED
@@ -164,7 +164,7 @@ module Decode
|
|
164
164
|
# Handle rest parameter (*args):
|
165
165
|
if node.parameters.respond_to?(:rest) && node.parameters.rest
|
166
166
|
rest_param = node.parameters.rest
|
167
|
-
name = rest_param.name
|
167
|
+
name = rest_param.respond_to?(:name) && rest_param.name ? rest_param.name : :args
|
168
168
|
base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
|
169
169
|
|
170
170
|
rest_positionals = ::RBS::Types::Function::Param.new(
|
@@ -192,7 +192,7 @@ module Decode
|
|
192
192
|
# Handle keyword rest parameter (**kwargs):
|
193
193
|
if node.parameters.respond_to?(:keyword_rest) && node.parameters.keyword_rest
|
194
194
|
rest_param = node.parameters.keyword_rest
|
195
|
-
if rest_param.name
|
195
|
+
if rest_param.respond_to?(:name) && rest_param.name
|
196
196
|
name = rest_param.name
|
197
197
|
base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
|
198
198
|
|
@@ -321,7 +321,7 @@ module Decode
|
|
321
321
|
# Handle rest parameter (*args):
|
322
322
|
if node.parameters.respond_to?(:rest) && node.parameters.rest
|
323
323
|
rest_param = node.parameters.rest
|
324
|
-
name = rest_param.name
|
324
|
+
name = rest_param.respond_to?(:name) && rest_param.name ? rest_param.name : :args
|
325
325
|
base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
|
326
326
|
# Rest parameters should be `Array[T]`:
|
327
327
|
array_type = ::RBS::Types::ClassInstance.new(
|
@@ -407,7 +407,7 @@ module Decode
|
|
407
407
|
# Handle keyword rest parameter (**kwargs):
|
408
408
|
if node.parameters.respond_to?(:keyword_rest) && node.parameters.keyword_rest
|
409
409
|
rest_param = node.parameters.keyword_rest
|
410
|
-
if rest_param.name
|
410
|
+
if rest_param.respond_to?(:name) && rest_param.name
|
411
411
|
name = rest_param.name
|
412
412
|
base_type = doc_types[name.to_s] || ::RBS::Parser.parse_type("untyped")
|
413
413
|
# Keyword rest should be `Hash[Symbol, T]`:
|
data/lib/decode/rbs/type.rb
CHANGED
data/lib/decode/trie.rb
CHANGED
data/lib/decode/version.rb
CHANGED
data/sig/decode.rbs
CHANGED
@@ -852,7 +852,8 @@ module Decode
|
|
852
852
|
|
853
853
|
@line: Integer
|
854
854
|
|
855
|
-
|
855
|
+
# Initialize a new location.
|
856
|
+
public def initialize: (String path, Integer line) -> void
|
856
857
|
|
857
858
|
# Generate a string representation of the location.
|
858
859
|
public def to_s: () -> untyped
|
@@ -994,6 +995,7 @@ module Decode
|
|
994
995
|
private def build_attributes_rbs: (Array attribute_definitions) -> Array
|
995
996
|
end
|
996
997
|
|
998
|
+
# Utilities for working with RBS types.
|
997
999
|
module Type
|
998
1000
|
# Check if an RBS type represents a nullable/optional type
|
999
1001
|
# This method recursively traverses the type tree to find nil anywhere
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|