ynl 0.3.0 → 0.4.2
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
- data/CHANGELOG.md +15 -0
- data/Rakefile +7 -0
- data/lib/ynl/family.rb +15 -2
- data/lib/ynl/generator.rb +811 -64
- data/lib/ynl/models.rb +21 -10
- data/lib/ynl/parser.rb +109 -42
- data/lib/ynl/version.rb +1 -1
- data/lib/ynl.rb +32 -4
- data/sig/generated/ynl/family.rbs +24 -0
- data/sig/generated/ynl/generator.rbs +163 -0
- data/sig/generated/ynl/models.rbs +165 -0
- data/sig/generated/ynl/parser.rbs +62 -0
- data/sig/generated/ynl/version.rbs +5 -0
- data/sig/generated/ynl.rbs +119 -0
- metadata +10 -4
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Generated from lib/ynl/models.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Ynl
|
|
4
|
+
module Models
|
|
5
|
+
Family: untyped
|
|
6
|
+
|
|
7
|
+
class Family
|
|
8
|
+
def resolve: () -> untyped
|
|
9
|
+
|
|
10
|
+
def find_type: (untyped name) -> untyped
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class Thunk
|
|
14
|
+
def initialize: () ?{ (?) -> untyped } -> untyped
|
|
15
|
+
|
|
16
|
+
def resolve: (untyped f) -> untyped
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Const: untyped
|
|
20
|
+
|
|
21
|
+
Check: untyped
|
|
22
|
+
|
|
23
|
+
class SubMessage
|
|
24
|
+
Format: untyped
|
|
25
|
+
|
|
26
|
+
attr_reader name: untyped
|
|
27
|
+
|
|
28
|
+
attr_reader formats: untyped
|
|
29
|
+
|
|
30
|
+
def initialize: (name: untyped) -> untyped
|
|
31
|
+
|
|
32
|
+
def resolve: (untyped f) -> untyped
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class Enum
|
|
36
|
+
Entry: untyped
|
|
37
|
+
|
|
38
|
+
attr_reader name: untyped
|
|
39
|
+
|
|
40
|
+
attr_reader entries: untyped
|
|
41
|
+
|
|
42
|
+
attr_reader doc: untyped
|
|
43
|
+
|
|
44
|
+
def initialize: (name: untyped, doc: untyped) -> untyped
|
|
45
|
+
|
|
46
|
+
def resolve: (untyped f) -> untyped
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
class Flags
|
|
50
|
+
Entry: untyped
|
|
51
|
+
|
|
52
|
+
attr_reader name: untyped
|
|
53
|
+
|
|
54
|
+
attr_reader entries: untyped
|
|
55
|
+
|
|
56
|
+
attr_reader doc: untyped
|
|
57
|
+
|
|
58
|
+
def initialize: (name: untyped, doc: untyped) -> untyped
|
|
59
|
+
|
|
60
|
+
def resolve: (untyped f) -> untyped
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class Struct
|
|
64
|
+
Member: untyped
|
|
65
|
+
|
|
66
|
+
attr_reader name: untyped
|
|
67
|
+
|
|
68
|
+
attr_reader members: untyped
|
|
69
|
+
|
|
70
|
+
attr_reader doc: untyped
|
|
71
|
+
|
|
72
|
+
def initialize: (name: untyped, doc: untyped) -> untyped
|
|
73
|
+
|
|
74
|
+
def resolve: (untyped f) -> untyped
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class AttributeSet
|
|
78
|
+
Attribute: untyped
|
|
79
|
+
|
|
80
|
+
attr_reader name: untyped
|
|
81
|
+
|
|
82
|
+
attr_reader name_prefix: untyped
|
|
83
|
+
|
|
84
|
+
attr_reader attributes: untyped
|
|
85
|
+
|
|
86
|
+
attr_reader doc: untyped
|
|
87
|
+
|
|
88
|
+
def initialize: (name: untyped, name_prefix: untyped, doc: untyped) -> untyped
|
|
89
|
+
|
|
90
|
+
def resolve: (untyped f) -> untyped
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
class AttributeSubset
|
|
94
|
+
attr_reader name: untyped
|
|
95
|
+
|
|
96
|
+
attr_reader superset: untyped
|
|
97
|
+
|
|
98
|
+
attr_reader doc: untyped
|
|
99
|
+
|
|
100
|
+
def initialize: (name: untyped, superset: untyped, attributes: untyped, doc: untyped) -> untyped
|
|
101
|
+
|
|
102
|
+
def attributes: () -> untyped
|
|
103
|
+
|
|
104
|
+
def resolve: (untyped f) -> untyped
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
McastGroup: untyped
|
|
108
|
+
|
|
109
|
+
class Operation
|
|
110
|
+
attr_reader name: untyped
|
|
111
|
+
|
|
112
|
+
attr_reader doc: untyped
|
|
113
|
+
|
|
114
|
+
attr_reader flags: untyped
|
|
115
|
+
|
|
116
|
+
attr_reader fixed_header: untyped
|
|
117
|
+
|
|
118
|
+
attr_reader attribute_set: untyped
|
|
119
|
+
|
|
120
|
+
attr_reader doit: untyped
|
|
121
|
+
|
|
122
|
+
attr_reader dumpit: untyped
|
|
123
|
+
|
|
124
|
+
attr_reader notification: untyped
|
|
125
|
+
|
|
126
|
+
def initialize: (name: untyped, doc: untyped, flags: untyped, fixed_header: untyped, attribute_set: untyped, doit: untyped, dumpit: untyped, notification: untyped) -> untyped
|
|
127
|
+
|
|
128
|
+
def resolve: (untyped f) -> untyped
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
class Notification
|
|
132
|
+
attr_reader kind: untyped
|
|
133
|
+
|
|
134
|
+
attr_reader message: untyped
|
|
135
|
+
|
|
136
|
+
attr_reader source: untyped
|
|
137
|
+
|
|
138
|
+
attr_reader group: untyped
|
|
139
|
+
|
|
140
|
+
def initialize: (kind: untyped, message: untyped, source: untyped, group: untyped) -> untyped
|
|
141
|
+
|
|
142
|
+
def resolve: (untyped f) -> untyped
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
class RequestReply
|
|
146
|
+
attr_reader request: untyped
|
|
147
|
+
|
|
148
|
+
attr_reader reply: untyped
|
|
149
|
+
|
|
150
|
+
def initialize: (request: untyped, reply: untyped) -> untyped
|
|
151
|
+
|
|
152
|
+
def resolve: (untyped f) -> untyped
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
class Message
|
|
156
|
+
attr_reader value: untyped
|
|
157
|
+
|
|
158
|
+
attr_reader attributes: untyped
|
|
159
|
+
|
|
160
|
+
def initialize: (value: untyped, attributes: untyped) -> untyped
|
|
161
|
+
|
|
162
|
+
def resolve: (untyped f) -> untyped
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Generated from lib/ynl/parser.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Ynl
|
|
4
|
+
class Parser
|
|
5
|
+
# @param [String, #read] source
|
|
6
|
+
# @rbs (String | _Readable source) -> void
|
|
7
|
+
def initialize: (String | _Readable source) -> void
|
|
8
|
+
|
|
9
|
+
# @param [String, #to_path] path
|
|
10
|
+
# @return [Models::Family]
|
|
11
|
+
# @rbs (String | _PathLike path) -> Models::Family
|
|
12
|
+
def self.parse_file: (String | _PathLike path) -> Models::Family
|
|
13
|
+
|
|
14
|
+
# @return [Models::Family]
|
|
15
|
+
# @rbs () -> Models::Family
|
|
16
|
+
def parse: () -> Models::Family
|
|
17
|
+
|
|
18
|
+
private def parse_definition: (untyped d) -> untyped
|
|
19
|
+
|
|
20
|
+
private def reject_enum_flags_name_collision: (untyped name, untyped other_definitions) -> untyped
|
|
21
|
+
|
|
22
|
+
private def parse_const: (untyped d) -> untyped
|
|
23
|
+
|
|
24
|
+
private def parse_enum_flags: (untyped d, type: untyped) -> untyped
|
|
25
|
+
|
|
26
|
+
private def parse_struct_member_type: (untyped d) -> untyped
|
|
27
|
+
|
|
28
|
+
private def parse_attribute_type: (untyped d) -> untyped
|
|
29
|
+
|
|
30
|
+
private def parse_indexed_array_sub_type: (untyped d) -> untyped
|
|
31
|
+
|
|
32
|
+
private def parse_packed_array_sub_type: (untyped d) -> untyped
|
|
33
|
+
|
|
34
|
+
private def parse_byte_order: (untyped v) -> untyped
|
|
35
|
+
|
|
36
|
+
private def parse_struct: (untyped d) -> untyped
|
|
37
|
+
|
|
38
|
+
private def parse_checks: (untyped d) -> untyped
|
|
39
|
+
|
|
40
|
+
private def parse_check: (untyped op, untyped value_literal) -> untyped
|
|
41
|
+
|
|
42
|
+
private def parse_value: (untyped v) -> untyped
|
|
43
|
+
|
|
44
|
+
private def parse_attribute_set: (untyped d) -> untyped
|
|
45
|
+
|
|
46
|
+
private def parse_attribute: (untyped d) -> untyped
|
|
47
|
+
|
|
48
|
+
private def parse_sub_message: (untyped d) -> untyped
|
|
49
|
+
|
|
50
|
+
private def parse_operation: (untyped d, request_id: untyped, reply_id: untyped) -> untyped
|
|
51
|
+
|
|
52
|
+
private def parse_notification: (untyped d, default_id: untyped) -> untyped
|
|
53
|
+
|
|
54
|
+
private def parse_request_reply: (untyped d, default_request_id: untyped, default_reply_id: untyped) -> untyped
|
|
55
|
+
|
|
56
|
+
private def parse_message: (untyped d, default_id: untyped) -> untyped
|
|
57
|
+
|
|
58
|
+
private def parse_mcast_group: (untyped d) -> untyped
|
|
59
|
+
|
|
60
|
+
private def translate_doc: (untyped doc) -> untyped
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Generated from lib/ynl.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Ynl parser and code generator. See {Family} for library entrypoint.
|
|
4
|
+
module Ynl
|
|
5
|
+
interface _Readable
|
|
6
|
+
def read: () -> String
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
interface _Writable
|
|
10
|
+
def write: (*String strings) -> untyped
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
interface _PathLike
|
|
14
|
+
def to_path: () -> String
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class ParseError < StandardError
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# @private
|
|
21
|
+
module Types
|
|
22
|
+
class Scalar < Data
|
|
23
|
+
attr_reader type(): untyped
|
|
24
|
+
|
|
25
|
+
attr_reader byte_order(): untyped
|
|
26
|
+
|
|
27
|
+
def self.new: (untyped type, untyped byte_order) -> instance
|
|
28
|
+
| (type: untyped, byte_order: untyped) -> instance
|
|
29
|
+
|
|
30
|
+
def self.members: () -> [ :type, :byte_order ]
|
|
31
|
+
|
|
32
|
+
def members: () -> [ :type, :byte_order ]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
class String < Struct[]
|
|
36
|
+
def self.new: () -> instance
|
|
37
|
+
| () -> instance
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
class Binary < Struct[untyped]
|
|
41
|
+
attr_accessor struct(): untyped
|
|
42
|
+
|
|
43
|
+
attr_accessor length(): untyped
|
|
44
|
+
|
|
45
|
+
attr_accessor display_hint(): untyped
|
|
46
|
+
|
|
47
|
+
def self.new: (?untyped struct, ?untyped length, ?untyped display_hint) -> instance
|
|
48
|
+
| (?struct: untyped, ?length: untyped, ?display_hint: untyped) -> instance
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
class PackedArray < Struct[untyped]
|
|
52
|
+
attr_accessor sub_type(): untyped
|
|
53
|
+
|
|
54
|
+
def self.new: (?untyped sub_type) -> instance
|
|
55
|
+
| (?sub_type: untyped) -> instance
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class NestedAttributes < Struct[untyped]
|
|
59
|
+
attr_accessor attribute_set(): untyped
|
|
60
|
+
|
|
61
|
+
def self.new: (?untyped attribute_set) -> instance
|
|
62
|
+
| (?attribute_set: untyped) -> instance
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class NestTypeValue < Struct[untyped]
|
|
66
|
+
attr_accessor attribute_set(): untyped
|
|
67
|
+
|
|
68
|
+
attr_accessor type_values(): untyped
|
|
69
|
+
|
|
70
|
+
def self.new: (?untyped attribute_set, ?untyped type_values) -> instance
|
|
71
|
+
| (?attribute_set: untyped, ?type_values: untyped) -> instance
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class SubMessage < Struct[untyped]
|
|
75
|
+
attr_accessor sub_message(): untyped
|
|
76
|
+
|
|
77
|
+
attr_accessor selector(): untyped
|
|
78
|
+
|
|
79
|
+
def self.new: (?untyped sub_message, ?untyped selector) -> instance
|
|
80
|
+
| (?sub_message: untyped, ?selector: untyped) -> instance
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class Pad < Data
|
|
84
|
+
attr_reader length(): untyped
|
|
85
|
+
|
|
86
|
+
def self.new: (untyped length) -> instance
|
|
87
|
+
| (length: untyped) -> instance
|
|
88
|
+
|
|
89
|
+
def self.members: () -> [ :length ]
|
|
90
|
+
|
|
91
|
+
def members: () -> [ :length ]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
class Flag < Data
|
|
95
|
+
def self.new: () -> instance
|
|
96
|
+
| () -> instance
|
|
97
|
+
|
|
98
|
+
def self.members: () -> [ ]
|
|
99
|
+
|
|
100
|
+
def members: () -> [ ]
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class Bitfield32 < Data
|
|
104
|
+
def self.new: () -> instance
|
|
105
|
+
| () -> instance
|
|
106
|
+
|
|
107
|
+
def self.members: () -> [ ]
|
|
108
|
+
|
|
109
|
+
def members: () -> [ ]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
class IndexedArray < Struct[untyped]
|
|
113
|
+
attr_accessor sub_type(): untyped
|
|
114
|
+
|
|
115
|
+
def self.new: (?untyped sub_type) -> instance
|
|
116
|
+
| (?sub_type: untyped) -> instance
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ynl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kasumi Hanazuki
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.4.2
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.4.2
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: yaml
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -56,6 +56,12 @@ files:
|
|
|
56
56
|
- lib/ynl/models.rb
|
|
57
57
|
- lib/ynl/parser.rb
|
|
58
58
|
- lib/ynl/version.rb
|
|
59
|
+
- sig/generated/ynl.rbs
|
|
60
|
+
- sig/generated/ynl/family.rbs
|
|
61
|
+
- sig/generated/ynl/generator.rbs
|
|
62
|
+
- sig/generated/ynl/models.rbs
|
|
63
|
+
- sig/generated/ynl/parser.rbs
|
|
64
|
+
- sig/generated/ynl/version.rbs
|
|
59
65
|
- test.rb
|
|
60
66
|
homepage: https://github.com/hanazuki/nl
|
|
61
67
|
licenses:
|
|
@@ -78,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
78
84
|
- !ruby/object:Gem::Version
|
|
79
85
|
version: '0'
|
|
80
86
|
requirements: []
|
|
81
|
-
rubygems_version: 4.0.
|
|
87
|
+
rubygems_version: 4.0.16
|
|
82
88
|
specification_version: 4
|
|
83
89
|
summary: YAML Netlink specification tools for Ruby
|
|
84
90
|
test_files: []
|