webidl 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webidl.rb +2 -0
- data/lib/webidl/ast/includes_statement.rb +14 -0
- data/lib/webidl/ast/interface.rb +3 -1
- data/lib/webidl/generator/ruby_sexp_visitor.rb +12 -0
- data/lib/webidl/parse_tree/includes_statement.rb +14 -0
- data/lib/webidl/parser/idl.treetop +8 -1
- data/lib/webidl/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d3979288eab2077bcd8f51b2a055e1e18eee79328d05208a2f552ff79b2c4b9
|
4
|
+
data.tar.gz: 9aef80033d70d43395a792459a697ff724279c3a9d89dc5b2dcf788346e3465c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '086454c736ab59133641d35eada54a82757c05e9a5ba2c16c2ece2b647278b79c5e45967fca175f956440809b9ac9fef85cb635e2ca114878cef49f715d49671'
|
7
|
+
data.tar.gz: 4bd7d17b33d2fafeb66aa6a3eadaf75eb6726d571f61a57a8acefc540196f145757d7dba45ffa033e4696e80eded1eb57cb43e4828c96e485f054ba2b45faf06
|
data/lib/webidl.rb
CHANGED
@@ -32,6 +32,7 @@ require "webidl/parse_tree/specials"
|
|
32
32
|
require "webidl/parse_tree/exception"
|
33
33
|
require "webidl/parse_tree/exception_field"
|
34
34
|
require "webidl/parse_tree/implements_statement"
|
35
|
+
require "webidl/parse_tree/includes_statement"
|
35
36
|
require "webidl/parse_tree/scoped_name_list"
|
36
37
|
require "webidl/parse_tree/stringifier_attribute_or_operation"
|
37
38
|
|
@@ -53,6 +54,7 @@ require "webidl/ast/exception"
|
|
53
54
|
require "webidl/ast/attribute"
|
54
55
|
require "webidl/ast/field"
|
55
56
|
require "webidl/ast/implements_statement"
|
57
|
+
require "webidl/ast/includes_statement"
|
56
58
|
require "webidl/ast/promise_type"
|
57
59
|
|
58
60
|
require "webidl/parser/debug_helper"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module WebIDL
|
2
|
+
module Ast
|
3
|
+
class IncludesStatement < Node
|
4
|
+
|
5
|
+
attr_reader :includer, :includee
|
6
|
+
|
7
|
+
def initialize(parent, includer_name, includee_name)
|
8
|
+
@includer = includer_name
|
9
|
+
@includee = includee_name
|
10
|
+
end
|
11
|
+
|
12
|
+
end # IncludesStatement
|
13
|
+
end # Ast
|
14
|
+
end # WebIDL
|
data/lib/webidl/ast/interface.rb
CHANGED
@@ -11,6 +11,7 @@ module WebIDL
|
|
11
11
|
:members,
|
12
12
|
:inherits,
|
13
13
|
:implements,
|
14
|
+
:includes,
|
14
15
|
:partial
|
15
16
|
|
16
17
|
def initialize(parent, name)
|
@@ -20,6 +21,7 @@ module WebIDL
|
|
20
21
|
@members = []
|
21
22
|
@inherits = []
|
22
23
|
@implements = []
|
24
|
+
@includes = []
|
23
25
|
@extended_attributes = []
|
24
26
|
@partial = false
|
25
27
|
end
|
@@ -30,4 +32,4 @@ module WebIDL
|
|
30
32
|
|
31
33
|
end # Interface
|
32
34
|
end # Ast
|
33
|
-
end # WebIDL
|
35
|
+
end # WebIDL
|
@@ -134,6 +134,18 @@ module WebIDL
|
|
134
134
|
]
|
135
135
|
end
|
136
136
|
|
137
|
+
def visit_includes_statement(incls)
|
138
|
+
[:module, classify(incls.includer),
|
139
|
+
[:scope,
|
140
|
+
[:call, nil, :include,
|
141
|
+
[:arglist,
|
142
|
+
[:const, classify(impls.includee)]
|
143
|
+
]
|
144
|
+
]
|
145
|
+
]
|
146
|
+
]
|
147
|
+
end
|
148
|
+
|
137
149
|
def visit_scoped_name(sn)
|
138
150
|
[:const, classify(sn.qualified_name)]
|
139
151
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module WebIDL
|
2
|
+
module ParseTree
|
3
|
+
class IncludesStatement < Treetop::Runtime::SyntaxNode
|
4
|
+
|
5
|
+
def build(parent)
|
6
|
+
includer_name = includer.build(parent).qualified_name
|
7
|
+
includee_name = includee.build(parent).qualified_name
|
8
|
+
|
9
|
+
Ast::IncludesStatement.new(parent, includer_name, includee_name)
|
10
|
+
end
|
11
|
+
|
12
|
+
end # IncludesStatement
|
13
|
+
end # ParseTree
|
14
|
+
end # WebIDL
|
@@ -17,6 +17,7 @@ module WebIDL
|
|
17
17
|
/ Exception
|
18
18
|
/ Enum
|
19
19
|
/ TypeDef
|
20
|
+
/ IncludesStatement
|
20
21
|
/ ImplementsStatement
|
21
22
|
end
|
22
23
|
|
@@ -29,7 +30,7 @@ module WebIDL
|
|
29
30
|
end
|
30
31
|
|
31
32
|
rule Interface
|
32
|
-
"interface" ws name:identifier ws inherits:Inheritance ws "{" ws members:InterfaceMembers ws "}" ws ";" <ParseTree::Interface>
|
33
|
+
"interface" ws (mixin:"mixin" ws)? name:identifier ws inherits:Inheritance ws "{" ws members:InterfaceMembers ws "}" ws ";" <ParseTree::Interface>
|
33
34
|
end
|
34
35
|
|
35
36
|
rule Partial
|
@@ -111,6 +112,10 @@ module WebIDL
|
|
111
112
|
implementor:ScopedName ws "implements" ws implementee:ScopedName ws ";" <ParseTree::ImplementsStatement>
|
112
113
|
end
|
113
114
|
|
115
|
+
rule IncludesStatement
|
116
|
+
includer:ScopedName ws "includes" ws includee:ScopedName ws ";" <ParseTree::IncludesStatement>
|
117
|
+
end
|
118
|
+
|
114
119
|
rule Const
|
115
120
|
"const" ws type:Type ws name:identifier ws "=" ws const_expr:ConstValue ws ";" <ParseTree::Const>
|
116
121
|
end
|
@@ -255,6 +260,7 @@ module WebIDL
|
|
255
260
|
/ "exception"
|
256
261
|
/ "getter"
|
257
262
|
/ "implements"
|
263
|
+
/ "includes"
|
258
264
|
/ "inherit"
|
259
265
|
/ "interface"
|
260
266
|
/ "legacycaller"
|
@@ -387,6 +393,7 @@ module WebIDL
|
|
387
393
|
/ "getraises"
|
388
394
|
/ "getter"
|
389
395
|
/ "implements"
|
396
|
+
/ "includes"
|
390
397
|
/ "in"
|
391
398
|
/ "interface"
|
392
399
|
/ "long"
|
data/lib/webidl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webidl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/webidl/ast/extended_attribute.rb
|
127
127
|
- lib/webidl/ast/field.rb
|
128
128
|
- lib/webidl/ast/implements_statement.rb
|
129
|
+
- lib/webidl/ast/includes_statement.rb
|
129
130
|
- lib/webidl/ast/interface.rb
|
130
131
|
- lib/webidl/ast/module.rb
|
131
132
|
- lib/webidl/ast/node.rb
|
@@ -154,6 +155,7 @@ files:
|
|
154
155
|
- lib/webidl/parse_tree/exception_field.rb
|
155
156
|
- lib/webidl/parse_tree/extended_attributes.rb
|
156
157
|
- lib/webidl/parse_tree/implements_statement.rb
|
158
|
+
- lib/webidl/parse_tree/includes_statement.rb
|
157
159
|
- lib/webidl/parse_tree/inheritance.rb
|
158
160
|
- lib/webidl/parse_tree/interface.rb
|
159
161
|
- lib/webidl/parse_tree/interface_members.rb
|