rdl 1.0.0 → 1.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +75 -12
- data/bin/rdl_query +24 -0
- data/lib/rdl.rb +2 -1
- data/lib/rdl/query.rb +96 -0
- data/lib/rdl/types/annotated_arg.rb +4 -1
- data/lib/rdl/types/dots_query.rb +26 -0
- data/lib/rdl/types/finitehash.rb +11 -3
- data/lib/rdl/types/generic.rb +8 -2
- data/lib/rdl/types/intersection.rb +10 -3
- data/lib/rdl/types/lexer.rex +4 -1
- data/lib/rdl/types/lexer.rex.rb +11 -2
- data/lib/rdl/types/method.rb +41 -4
- data/lib/rdl/types/nil.rb +8 -2
- data/lib/rdl/types/nominal.rb +8 -2
- data/lib/rdl/types/optional.rb +9 -3
- data/lib/rdl/types/parser.racc +10 -6
- data/lib/rdl/types/parser.tab.rb +305 -257
- data/lib/rdl/types/singleton.rb +10 -3
- data/lib/rdl/types/structural.rb +9 -2
- data/lib/rdl/types/top.rb +9 -3
- data/lib/rdl/types/tuple.rb +9 -3
- data/lib/rdl/types/type_query.rb +5 -0
- data/lib/rdl/types/union.rb +11 -4
- data/lib/rdl/types/var.rb +6 -0
- data/lib/rdl/types/vararg.rb +8 -2
- data/lib/rdl/types/wild_query.rb +28 -0
- data/lib/rdl/util.rb +18 -5
- data/lib/rdl/wrap.rb +3 -37
- data/rdl.gemspec +3 -2
- data/test/test_parser.rb +24 -24
- data/test/test_query.rb +108 -0
- data/test/test_rdl.rb +4 -4
- data/types/ruby-2.x/file.rb +3 -1
- data/types/ruby-2.x/fileutils.rb +2 -2
- metadata +13 -6
data/lib/rdl/types/lexer.rex.rb
CHANGED
@@ -103,12 +103,21 @@ class Parser < Racc::Parser
|
|
103
103
|
when (text = @ss.scan(/\*/))
|
104
104
|
action { [:STAR, text] }
|
105
105
|
|
106
|
-
when (text = @ss.scan(
|
107
|
-
action { [:
|
106
|
+
when (text = @ss.scan(/\#T/))
|
107
|
+
action { [:HASH_TYPE, text] }
|
108
|
+
|
109
|
+
when (text = @ss.scan(/\#Q/))
|
110
|
+
action { [:HASH_QUERY, text] }
|
108
111
|
|
109
112
|
when (text = @ss.scan(/\$\{/))
|
110
113
|
action { [:CONST_BEGIN, text] }
|
111
114
|
|
115
|
+
when (text = @ss.scan(/\.\.\./))
|
116
|
+
action { [:DOTS, text] }
|
117
|
+
|
118
|
+
when (text = @ss.scan(/\./))
|
119
|
+
action { [:DOT, text] }
|
120
|
+
|
112
121
|
when (text = @ss.scan(/-?\d\.\d+/))
|
113
122
|
action { [:FLOAT, text] } # Must go before FIXNUM
|
114
123
|
|
data/lib/rdl/types/method.rb
CHANGED
@@ -11,7 +11,7 @@ module RDL::Type
|
|
11
11
|
attr_reader :ret
|
12
12
|
|
13
13
|
@@contract_cache = {}
|
14
|
-
|
14
|
+
|
15
15
|
# Create a new MethodType
|
16
16
|
#
|
17
17
|
# [+args+] List of types of the arguments of the procedure (use [] for no args).
|
@@ -190,13 +190,13 @@ RUBY
|
|
190
190
|
return false # one has a block and the other doesn't
|
191
191
|
end
|
192
192
|
end
|
193
|
-
|
193
|
+
|
194
194
|
def instantiate(inst)
|
195
195
|
return MethodType.new(@args.map { |arg| arg.instantiate(inst) },
|
196
196
|
@block ? @block.instantiate(inst) : nil,
|
197
197
|
@ret.instantiate(inst))
|
198
198
|
end
|
199
|
-
|
199
|
+
|
200
200
|
def eql?(other)
|
201
201
|
self == other
|
202
202
|
end
|
@@ -209,6 +209,44 @@ RUBY
|
|
209
209
|
(other.ret == @ret)
|
210
210
|
end
|
211
211
|
|
212
|
+
# other may not be a query
|
213
|
+
def match(other)
|
214
|
+
other = other.type if other.instance_of? AnnotatedArgType
|
215
|
+
return true if other.instance_of? WildQuery
|
216
|
+
return false unless @ret.match(other.ret)
|
217
|
+
if @block == nil
|
218
|
+
return false unless other.block == nil
|
219
|
+
else
|
220
|
+
return false if other.block == nil
|
221
|
+
return false unless @block.match(other.block)
|
222
|
+
end
|
223
|
+
# Check arg matches; logic is similar to pre_cond
|
224
|
+
states = [[0,0]] # [position in self, position in other]
|
225
|
+
until states.empty?
|
226
|
+
s_arg, o_arg = states.pop
|
227
|
+
return true if s_arg == @args.size && o_arg == other.args.size # everything matches
|
228
|
+
next if s_arg >= @args.size # match not possible, not enough args in self
|
229
|
+
if @args[s_arg].instance_of? DotsQuery then
|
230
|
+
if o_arg == other.args.size
|
231
|
+
# no args left in other, skip ...
|
232
|
+
states << [s_arg+1, o_arg]
|
233
|
+
else
|
234
|
+
states << [s_arg+1, o_arg+1] # match, no more matches to ...
|
235
|
+
states << [s_arg, o_arg+1] # match, more matches to ... coming
|
236
|
+
end
|
237
|
+
else
|
238
|
+
next if o_arg == other.args.size # match not possible, not enough args in other
|
239
|
+
s_arg_t = @args[s_arg]
|
240
|
+
s_arg_t = s_arg_t.type if s_arg_t.instance_of? AnnotatedArgType
|
241
|
+
o_arg_t = other.args[o_arg]
|
242
|
+
o_arg_t = o_arg_t.type if o_arg_t.instance_of? AnnotatedArgType
|
243
|
+
next unless s_arg_t.match(o_arg_t)
|
244
|
+
states << [s_arg+1, o_arg+1]
|
245
|
+
end
|
246
|
+
end
|
247
|
+
return false
|
248
|
+
end
|
249
|
+
|
212
250
|
def hash # :nodoc:
|
213
251
|
h = (37 + @ret.hash) * 41 + @args.hash
|
214
252
|
h = h * 31 + @block.hash if @block
|
@@ -216,4 +254,3 @@ RUBY
|
|
216
254
|
end
|
217
255
|
end
|
218
256
|
end
|
219
|
-
|
data/lib/rdl/types/nil.rb
CHANGED
@@ -29,6 +29,12 @@ module RDL::Type
|
|
29
29
|
other.instance_of? NilType
|
30
30
|
end
|
31
31
|
|
32
|
+
def match(other)
|
33
|
+
other = other.type if other.instance_of? AnnotatedArgType
|
34
|
+
return true if other.instance_of? WildQuery
|
35
|
+
return self == other
|
36
|
+
end
|
37
|
+
|
32
38
|
def <=(other)
|
33
39
|
true
|
34
40
|
end
|
@@ -38,11 +44,11 @@ module RDL::Type
|
|
38
44
|
return t <= self if t
|
39
45
|
obj.nil?
|
40
46
|
end
|
41
|
-
|
47
|
+
|
42
48
|
def instantiate(inst)
|
43
49
|
return self
|
44
50
|
end
|
45
|
-
|
51
|
+
|
46
52
|
def hash
|
47
53
|
13
|
48
54
|
end
|
data/lib/rdl/types/nominal.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative 'type'
|
|
3
3
|
module RDL::Type
|
4
4
|
class NominalType < Type
|
5
5
|
attr_reader :name # string
|
6
|
-
|
6
|
+
|
7
7
|
@@cache = {}
|
8
8
|
|
9
9
|
class << self
|
@@ -31,6 +31,12 @@ module RDL::Type
|
|
31
31
|
return (other.instance_of? self.class) && (other.name == @name)
|
32
32
|
end
|
33
33
|
|
34
|
+
def match(other)
|
35
|
+
other = other.type if other.instance_of? AnnotatedArgType
|
36
|
+
return true if other.instance_of? WildQuery
|
37
|
+
return self == other
|
38
|
+
end
|
39
|
+
|
34
40
|
def hash # :nodoc:
|
35
41
|
return @name.hash
|
36
42
|
end
|
@@ -72,7 +78,7 @@ module RDL::Type
|
|
72
78
|
return true if obj.nil?
|
73
79
|
return obj.is_a? klass
|
74
80
|
end
|
75
|
-
|
81
|
+
|
76
82
|
def instantiate(inst)
|
77
83
|
return self
|
78
84
|
end
|
data/lib/rdl/types/optional.rb
CHANGED
@@ -13,7 +13,7 @@ module RDL::Type
|
|
13
13
|
def self.new(type)
|
14
14
|
t = @@cache[type]
|
15
15
|
return t if t
|
16
|
-
raise RuntimeError, "Attempt to create
|
16
|
+
raise RuntimeError, "Attempt to create optional type with non-type" unless type.is_a? Type
|
17
17
|
t = OptionalType.__new__ type
|
18
18
|
return (@@cache[type] = t) # assignment evaluates to t
|
19
19
|
end
|
@@ -41,12 +41,18 @@ module RDL::Type
|
|
41
41
|
return (other.instance_of? OptionalType) && (other.type == @type)
|
42
42
|
end
|
43
43
|
|
44
|
+
def match(other)
|
45
|
+
other = other.type if other.instance_of? AnnotatedArgType
|
46
|
+
return true if other.instance_of? WildQuery
|
47
|
+
return (other.instance_of? OptionalType) && (@type.match(other.type))
|
48
|
+
end
|
49
|
+
|
44
50
|
# Note: no member?, because these can only appear in MethodType, where they're handled specially
|
45
|
-
|
51
|
+
|
46
52
|
def instantiate(inst)
|
47
53
|
return OptionalType.new(@type.instantiate(inst))
|
48
54
|
end
|
49
|
-
|
55
|
+
|
50
56
|
def hash # :nodoc:
|
51
57
|
return 57 + @type.hash
|
52
58
|
end
|
data/lib/rdl/types/parser.racc
CHANGED
@@ -7,8 +7,8 @@ class Parser
|
|
7
7
|
|
8
8
|
start entry
|
9
9
|
|
10
|
-
token
|
11
|
-
token OR FIXNUM FLOAT COLON RARROW ID SYMBOL SPECIAL_ID STRING
|
10
|
+
token HASH_TYPE HASH_QUERY CONST_BEGIN RASSOC
|
11
|
+
token OR FIXNUM FLOAT COLON RARROW DOT DOTS ID SYMBOL SPECIAL_ID STRING
|
12
12
|
token LPAREN RPAREN LBRACE RBRACE LBRACKET RBRACKET
|
13
13
|
token COMMA QUERY STAR LESS GREATER
|
14
14
|
token EOF
|
@@ -18,11 +18,13 @@ rule
|
|
18
18
|
entry:
|
19
19
|
method_type { result = val[0] }
|
20
20
|
| bare_type { result = val[0] }
|
21
|
+
| query_type { result = val[0] }
|
21
22
|
|
22
23
|
bare_type:
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
HASH_TYPE type_expr { result = val[1] }
|
25
|
+
|
26
|
+
query_type:
|
27
|
+
HASH_QUERY method_type { result = RDL::Type::MethodType.new val[1].args, val[1].block, val[1].ret }
|
26
28
|
|
27
29
|
method_type:
|
28
30
|
LPAREN arg_list RPAREN block RARROW type_expr {
|
@@ -51,6 +53,7 @@ rule
|
|
51
53
|
arg:
|
52
54
|
base_arg { result = val[0] }
|
53
55
|
| base_arg ID { result = RDL::Type::AnnotatedArgType.new(val[1], val[0]) }
|
56
|
+
| DOTS { result = RDL::Type::DotsQuery.new }
|
54
57
|
named_arg_list:
|
55
58
|
named_arg { result = val[0] }
|
56
59
|
| named_arg COMMA named_arg_list { result = val[0] + val[2] }
|
@@ -112,7 +115,7 @@ rule
|
|
112
115
|
fail "Unexpected special type identifier #{val[0]}"
|
113
116
|
end
|
114
117
|
}
|
115
|
-
| ID LESS type_expr_comma_list GREATER {
|
118
|
+
| ID LESS type_expr_comma_list GREATER {
|
116
119
|
n = RDL::Type::NominalType.new(val[0])
|
117
120
|
result = RDL::Type::GenericType.new(n, *val[2])
|
118
121
|
}
|
@@ -132,6 +135,7 @@ rule
|
|
132
135
|
}
|
133
136
|
# The following can't be used in SingletonTypes because those compare using .equal?
|
134
137
|
# | STRING { result = RDL::Type::SingletonType.new(val[0]) }
|
138
|
+
| DOT { result = RDL::Type::WildQuery.new }
|
135
139
|
|
136
140
|
---- header ----
|
137
141
|
|
data/lib/rdl/types/parser.tab.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# DO NOT MODIFY!!!!
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
3
|
+
# This file is automatically generated by Racc 1.4.14
|
4
4
|
# from Racc grammer file "".
|
5
5
|
#
|
6
6
|
|
@@ -13,7 +13,7 @@ module RDL::Type
|
|
13
13
|
|
14
14
|
class Parser < Racc::Parser
|
15
15
|
|
16
|
-
module_eval(<<'...end parser.racc/module_eval...', 'parser.racc',
|
16
|
+
module_eval(<<'...end parser.racc/module_eval...', 'parser.racc', 147)
|
17
17
|
|
18
18
|
def initialize()
|
19
19
|
@yydebug = true
|
@@ -23,162 +23,176 @@ end
|
|
23
23
|
##### State transition tables begin ###
|
24
24
|
|
25
25
|
racc_action_table = [
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
16,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
nil,
|
46
|
-
nil,
|
47
|
-
|
48
|
-
|
26
|
+
20, 55, 18, 19, 71, 21, 28, 30, 13, 15,
|
27
|
+
73, 11, 42, 17, 61, 16, 37, 31, 32, 20,
|
28
|
+
80, 18, 19, 7, 21, 28, 30, 13, 15, 37,
|
29
|
+
11, 85, 17, 88, 16, 7, 31, 32, 20, 91,
|
30
|
+
18, 19, 92, 21, 94, 14, 13, 15, 95, 11,
|
31
|
+
98, 17, 61, 16, 20, 78, 18, 19, 8, 21,
|
32
|
+
7, 14, 13, 15, 34, 11, 36, 17, 20, 16,
|
33
|
+
18, 19, 37, 21, 50, 14, 13, 15, 51, 5,
|
34
|
+
6, 17, 20, 16, 18, 19, 52, 21, 53, 14,
|
35
|
+
13, 15, 7, 54, 58, 17, 20, 16, 18, 19,
|
36
|
+
62, 21, 63, 14, 13, 15, 64, 55, 65, 17,
|
37
|
+
20, 16, 18, 19, 66, 21, 67, 14, 13, 15,
|
38
|
+
68, 11, 69, 17, 20, 16, 18, 19, 70, 21,
|
39
|
+
nil, 14, 13, 15, nil, 11, nil, 17, 20, 16,
|
40
|
+
18, 19, nil, 21, nil, 38, 13, 15, nil, 11,
|
41
|
+
nil, 17, 20, 16, 18, 19, nil, 21, nil, 14,
|
42
|
+
13, 15, nil, 11, nil, 17, 20, 16, 18, 19,
|
43
|
+
nil, 21, nil, 14, 13, 15, nil, nil, nil, 17,
|
44
|
+
20, 16, 18, 19, nil, 21, nil, 14, 13, 15,
|
45
|
+
nil, 11, nil, 17, 20, 16, 18, 19, nil, 21,
|
46
|
+
nil, 14, 13, 15, nil, 11, nil, 17, 20, 16,
|
47
|
+
18, 19, nil, 21, nil, 14, 13, 15, nil, 11,
|
48
|
+
nil, 17, 20, 16, 18, 19, nil, 21, nil, 14,
|
49
|
+
13, 15, nil, nil, nil, 17, 20, 16, 18, 19,
|
50
|
+
nil, 21, nil, 14, 13, 15, nil, 11, nil, 17,
|
51
|
+
46, 16, 44, 45, nil, nil, 46, 42, 44, 45,
|
52
|
+
47, nil, nil, 42, nil, nil, 47 ]
|
49
53
|
|
50
54
|
racc_action_check = [
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
nil,
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
nil,
|
71
|
-
nil,
|
72
|
-
|
73
|
-
|
55
|
+
7, 30, 7, 7, 50, 7, 7, 7, 7, 7,
|
56
|
+
51, 7, 54, 7, 38, 7, 30, 7, 7, 52,
|
57
|
+
60, 52, 52, 61, 52, 52, 52, 52, 52, 38,
|
58
|
+
52, 67, 52, 72, 52, 73, 52, 52, 55, 81,
|
59
|
+
55, 55, 85, 55, 89, 55, 55, 55, 91, 55,
|
60
|
+
93, 55, 95, 55, 62, 55, 62, 62, 1, 62,
|
61
|
+
6, 62, 62, 62, 8, 62, 12, 62, 65, 62,
|
62
|
+
65, 65, 14, 65, 20, 65, 65, 65, 23, 0,
|
63
|
+
0, 65, 66, 65, 66, 66, 26, 66, 27, 66,
|
64
|
+
66, 66, 0, 29, 35, 66, 68, 66, 68, 68,
|
65
|
+
39, 68, 40, 68, 68, 68, 41, 42, 44, 68,
|
66
|
+
31, 68, 31, 31, 45, 31, 46, 31, 31, 31,
|
67
|
+
47, 31, 48, 31, 5, 31, 5, 5, 49, 5,
|
68
|
+
nil, 5, 5, 5, nil, 5, nil, 5, 16, 5,
|
69
|
+
16, 16, nil, 16, nil, 16, 16, 16, nil, 16,
|
70
|
+
nil, 16, 37, 16, 37, 37, nil, 37, nil, 37,
|
71
|
+
37, 37, nil, 37, nil, 37, 92, 37, 92, 92,
|
72
|
+
nil, 92, nil, 92, 92, 92, nil, nil, nil, 92,
|
73
|
+
32, 92, 32, 32, nil, 32, nil, 32, 32, 32,
|
74
|
+
nil, 32, nil, 32, 78, 32, 78, 78, nil, 78,
|
75
|
+
nil, 78, 78, 78, nil, 78, nil, 78, 11, 78,
|
76
|
+
11, 11, nil, 11, nil, 11, 11, 11, nil, 11,
|
77
|
+
nil, 11, 36, 11, 36, 36, nil, 36, nil, 36,
|
78
|
+
36, 36, nil, nil, nil, 36, 88, 36, 88, 88,
|
79
|
+
nil, 88, nil, 88, 88, 88, nil, 88, nil, 88,
|
80
|
+
69, 88, 69, 69, nil, nil, 17, 69, 17, 17,
|
81
|
+
69, nil, nil, 17, nil, nil, 17 ]
|
74
82
|
|
75
83
|
racc_action_pointer = [
|
76
|
-
|
77
|
-
|
78
|
-
nil, nil,
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
nil, nil,
|
84
|
-
|
85
|
-
|
84
|
+
74, 58, nil, nil, nil, 117, 42, -7, 64, nil,
|
85
|
+
nil, 201, 62, nil, 46, nil, 131, 249, nil, nil,
|
86
|
+
60, nil, nil, 59, nil, nil, 84, 74, nil, 91,
|
87
|
+
-10, 103, 173, nil, nil, 75, 215, 145, 3, 98,
|
88
|
+
79, 83, 96, nil, 100, 106, 102, 112, 120, 107,
|
89
|
+
-17, -10, 12, nil, -2, 31, nil, nil, nil, nil,
|
90
|
+
-7, 5, 47, nil, nil, 61, 75, 10, 89, 243,
|
91
|
+
nil, nil, 30, 17, nil, nil, nil, nil, 187, nil,
|
92
|
+
nil, 37, nil, nil, nil, 34, nil, nil, 229, 23,
|
93
|
+
nil, 34, 159, 36, nil, 41, nil, nil, nil ]
|
86
94
|
|
87
95
|
racc_action_default = [
|
88
|
-
-
|
89
|
-
-
|
90
|
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
96
|
+
-54, -54, -1, -2, -3, -54, -54, -10, -54, -4,
|
97
|
+
-29, -54, -41, -43, -44, -45, -54, -33, -50, -51,
|
98
|
+
-54, -53, -5, -54, -11, -12, -13, -16, -18, -19,
|
99
|
+
-44, -54, -54, -24, 99, -54, -54, -54, -44, -31,
|
100
|
+
-54, -54, -54, -34, -54, -54, -54, -54, -39, -54,
|
101
|
+
-54, -27, -54, -17, -54, -54, -22, -23, -30, -42,
|
102
|
+
-54, -54, -54, -47, -48, -54, -54, -54, -54, -33,
|
103
|
+
-49, -52, -54, -54, -14, -15, -20, -21, -54, -26,
|
104
|
+
-46, -8, -32, -35, -36, -54, -38, -40, -54, -54,
|
105
|
+
-25, -54, -54, -6, -28, -54, -9, -37, -7 ]
|
98
106
|
|
99
107
|
racc_goto_table = [
|
100
|
-
|
101
|
-
|
102
|
-
nil, nil,
|
103
|
-
|
104
|
-
nil, nil, nil,
|
105
|
-
|
106
|
-
|
107
|
-
nil,
|
108
|
+
9, 41, 33, 59, 2, 49, 35, 25, 43, 40,
|
109
|
+
22, 24, 77, 3, 72, 23, 4, 1, nil, nil,
|
110
|
+
nil, nil, nil, nil, nil, nil, 56, 57, nil, nil,
|
111
|
+
60, nil, 83, 84, nil, 86, nil, nil, nil, nil,
|
112
|
+
nil, nil, nil, nil, nil, nil, nil, 33, nil, nil,
|
113
|
+
79, nil, 75, nil, 76, 82, 74, 87, nil, 97,
|
114
|
+
43, nil, nil, nil, nil, 81, nil, nil, nil, nil,
|
115
|
+
nil, nil, nil, 90, nil, nil, 96, 89, nil, nil,
|
116
|
+
nil, nil, nil, 93 ]
|
108
117
|
|
109
118
|
racc_goto_check = [
|
110
|
-
|
111
|
-
|
112
|
-
nil, nil,
|
113
|
-
|
114
|
-
nil, nil, nil,
|
115
|
-
|
116
|
-
|
117
|
-
nil,
|
119
|
+
5, 8, 5, 15, 2, 18, 5, 10, 13, 16,
|
120
|
+
2, 9, 14, 3, 7, 6, 4, 1, nil, nil,
|
121
|
+
nil, nil, nil, nil, nil, nil, 5, 5, nil, nil,
|
122
|
+
16, nil, 15, 15, nil, 15, nil, nil, nil, nil,
|
123
|
+
nil, nil, nil, nil, nil, nil, nil, 5, nil, nil,
|
124
|
+
5, nil, 10, nil, 10, 16, 9, 18, nil, 15,
|
125
|
+
13, nil, nil, nil, nil, 2, nil, nil, nil, nil,
|
126
|
+
nil, nil, nil, 5, nil, nil, 8, 2, nil, nil,
|
127
|
+
nil, nil, nil, 5 ]
|
118
128
|
|
119
129
|
racc_goto_pointer = [
|
120
|
-
nil,
|
121
|
-
nil, nil, -
|
130
|
+
nil, 17, 4, 13, 16, -5, 8, -37, -15, 4,
|
131
|
+
0, nil, nil, -9, -43, -33, -7, nil, -12, nil ]
|
122
132
|
|
123
133
|
racc_goto_default = [
|
124
|
-
nil, nil, nil, nil,
|
125
|
-
|
134
|
+
nil, nil, nil, nil, nil, 39, nil, nil, nil, nil,
|
135
|
+
nil, 26, 27, 29, nil, 10, nil, 48, nil, 12 ]
|
126
136
|
|
127
137
|
racc_reduce_table = [
|
128
138
|
0, 0, :racc_error,
|
129
|
-
1,
|
130
|
-
1,
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
1,
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
1,
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
2,
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
1,
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
1,
|
160
|
-
3,
|
161
|
-
|
162
|
-
|
163
|
-
3,
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
139
|
+
1, 30, :_reduce_1,
|
140
|
+
1, 30, :_reduce_2,
|
141
|
+
1, 30, :_reduce_3,
|
142
|
+
2, 32, :_reduce_4,
|
143
|
+
2, 33, :_reduce_5,
|
144
|
+
6, 31, :_reduce_6,
|
145
|
+
7, 31, :_reduce_7,
|
146
|
+
3, 37, :_reduce_8,
|
147
|
+
5, 37, :_reduce_9,
|
148
|
+
0, 35, :_reduce_10,
|
149
|
+
1, 35, :_reduce_11,
|
150
|
+
1, 35, :_reduce_12,
|
151
|
+
1, 38, :_reduce_13,
|
152
|
+
3, 38, :_reduce_14,
|
153
|
+
3, 38, :_reduce_15,
|
154
|
+
1, 40, :_reduce_16,
|
155
|
+
2, 40, :_reduce_17,
|
156
|
+
1, 40, :_reduce_18,
|
157
|
+
1, 39, :_reduce_19,
|
158
|
+
3, 39, :_reduce_20,
|
159
|
+
3, 42, :_reduce_21,
|
160
|
+
2, 41, :_reduce_22,
|
161
|
+
2, 41, :_reduce_23,
|
162
|
+
1, 41, :_reduce_24,
|
163
|
+
2, 43, :_reduce_25,
|
164
|
+
1, 43, :_reduce_26,
|
165
|
+
0, 36, :_reduce_27,
|
166
|
+
3, 36, :_reduce_28,
|
167
|
+
1, 34, :_reduce_29,
|
168
|
+
3, 34, :_reduce_30,
|
169
|
+
1, 45, :_reduce_31,
|
170
|
+
3, 45, :_reduce_32,
|
171
|
+
0, 46, :_reduce_none,
|
172
|
+
1, 46, :_reduce_34,
|
173
|
+
3, 46, :_reduce_35,
|
174
|
+
3, 46, :_reduce_36,
|
175
|
+
5, 46, :_reduce_37,
|
176
|
+
3, 46, :_reduce_38,
|
177
|
+
1, 47, :_reduce_39,
|
178
|
+
3, 47, :_reduce_40,
|
169
179
|
1, 44, :_reduce_41,
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
3,
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
180
|
+
3, 44, :_reduce_42,
|
181
|
+
1, 48, :_reduce_43,
|
182
|
+
1, 48, :_reduce_44,
|
183
|
+
1, 48, :_reduce_45,
|
184
|
+
4, 48, :_reduce_46,
|
185
|
+
3, 48, :_reduce_47,
|
186
|
+
3, 48, :_reduce_48,
|
187
|
+
3, 48, :_reduce_49,
|
188
|
+
1, 48, :_reduce_50,
|
189
|
+
1, 48, :_reduce_51,
|
190
|
+
3, 48, :_reduce_52,
|
191
|
+
1, 48, :_reduce_53 ]
|
192
|
+
|
193
|
+
racc_reduce_n = 54
|
194
|
+
|
195
|
+
racc_shift_n = 99
|
182
196
|
|
183
197
|
racc_token_table = {
|
184
198
|
false => 0,
|
@@ -186,29 +200,32 @@ racc_token_table = {
|
|
186
200
|
:COMMA => 2,
|
187
201
|
:RARROW => 3,
|
188
202
|
:OR => 4,
|
189
|
-
:
|
190
|
-
:
|
191
|
-
:
|
192
|
-
:
|
193
|
-
:
|
194
|
-
:
|
195
|
-
:
|
196
|
-
:
|
197
|
-
:
|
198
|
-
:
|
199
|
-
:
|
200
|
-
:
|
201
|
-
:
|
202
|
-
:
|
203
|
-
:
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
:
|
208
|
-
:
|
209
|
-
:
|
210
|
-
|
211
|
-
|
203
|
+
:HASH_TYPE => 5,
|
204
|
+
:HASH_QUERY => 6,
|
205
|
+
:CONST_BEGIN => 7,
|
206
|
+
:RASSOC => 8,
|
207
|
+
:FIXNUM => 9,
|
208
|
+
:FLOAT => 10,
|
209
|
+
:COLON => 11,
|
210
|
+
:DOT => 12,
|
211
|
+
:DOTS => 13,
|
212
|
+
:ID => 14,
|
213
|
+
:SYMBOL => 15,
|
214
|
+
:SPECIAL_ID => 16,
|
215
|
+
:STRING => 17,
|
216
|
+
:LPAREN => 18,
|
217
|
+
:RPAREN => 19,
|
218
|
+
:LBRACE => 20,
|
219
|
+
:RBRACE => 21,
|
220
|
+
:LBRACKET => 22,
|
221
|
+
:RBRACKET => 23,
|
222
|
+
:QUERY => 24,
|
223
|
+
:STAR => 25,
|
224
|
+
:LESS => 26,
|
225
|
+
:GREATER => 27,
|
226
|
+
:EOF => 28 }
|
227
|
+
|
228
|
+
racc_nt_base = 29
|
212
229
|
|
213
230
|
racc_use_result_var = true
|
214
231
|
|
@@ -234,12 +251,15 @@ Racc_token_to_s_table = [
|
|
234
251
|
"COMMA",
|
235
252
|
"RARROW",
|
236
253
|
"OR",
|
237
|
-
"
|
254
|
+
"HASH_TYPE",
|
255
|
+
"HASH_QUERY",
|
238
256
|
"CONST_BEGIN",
|
239
257
|
"RASSOC",
|
240
258
|
"FIXNUM",
|
241
259
|
"FLOAT",
|
242
260
|
"COLON",
|
261
|
+
"DOT",
|
262
|
+
"DOTS",
|
243
263
|
"ID",
|
244
264
|
"SYMBOL",
|
245
265
|
"SPECIAL_ID",
|
@@ -259,6 +279,7 @@ Racc_token_to_s_table = [
|
|
259
279
|
"entry",
|
260
280
|
"method_type",
|
261
281
|
"bare_type",
|
282
|
+
"query_type",
|
262
283
|
"type_expr",
|
263
284
|
"arg_list",
|
264
285
|
"block",
|
@@ -295,276 +316,296 @@ module_eval(<<'.,.,', 'parser.racc', 19)
|
|
295
316
|
end
|
296
317
|
.,.,
|
297
318
|
|
298
|
-
module_eval(<<'.,.,', 'parser.racc',
|
319
|
+
module_eval(<<'.,.,', 'parser.racc', 20)
|
299
320
|
def _reduce_3(val, _values, result)
|
300
|
-
|
301
|
-
|
321
|
+
result = val[0]
|
302
322
|
result
|
303
323
|
end
|
304
324
|
.,.,
|
305
325
|
|
306
|
-
module_eval(<<'.,.,', 'parser.racc',
|
326
|
+
module_eval(<<'.,.,', 'parser.racc', 23)
|
307
327
|
def _reduce_4(val, _values, result)
|
308
|
-
|
309
|
-
|
328
|
+
result = val[1]
|
310
329
|
result
|
311
330
|
end
|
312
331
|
.,.,
|
313
332
|
|
314
|
-
module_eval(<<'.,.,', 'parser.racc',
|
333
|
+
module_eval(<<'.,.,', 'parser.racc', 26)
|
315
334
|
def _reduce_5(val, _values, result)
|
316
|
-
|
317
|
-
|
335
|
+
result = RDL::Type::MethodType.new val[1].args, val[1].block, val[1].ret
|
318
336
|
result
|
319
337
|
end
|
320
338
|
.,.,
|
321
339
|
|
322
|
-
module_eval(<<'.,.,', 'parser.racc',
|
340
|
+
module_eval(<<'.,.,', 'parser.racc', 30)
|
323
341
|
def _reduce_6(val, _values, result)
|
324
|
-
|
342
|
+
result = RDL::Type::MethodType.new val[1], val[3], val[5]
|
343
|
+
|
325
344
|
result
|
326
345
|
end
|
327
346
|
.,.,
|
328
347
|
|
329
|
-
module_eval(<<'.,.,', 'parser.racc',
|
348
|
+
module_eval(<<'.,.,', 'parser.racc', 33)
|
330
349
|
def _reduce_7(val, _values, result)
|
331
|
-
|
350
|
+
result = RDL::Type::MethodType.new val[1], val[3], RDL::Type::AnnotatedArgType.new(val[6], val[5])
|
351
|
+
|
332
352
|
result
|
333
353
|
end
|
334
354
|
.,.,
|
335
355
|
|
336
|
-
module_eval(<<'.,.,', 'parser.racc',
|
356
|
+
module_eval(<<'.,.,', 'parser.racc', 37)
|
337
357
|
def _reduce_8(val, _values, result)
|
338
|
-
result = []
|
358
|
+
result = [val[0].to_sym, val[2]]
|
339
359
|
result
|
340
360
|
end
|
341
361
|
.,.,
|
342
362
|
|
343
|
-
module_eval(<<'.,.,', 'parser.racc',
|
363
|
+
module_eval(<<'.,.,', 'parser.racc', 38)
|
344
364
|
def _reduce_9(val, _values, result)
|
345
|
-
result = val[0]
|
365
|
+
result = [val[0].to_sym, val[2]] + val[4]
|
346
366
|
result
|
347
367
|
end
|
348
368
|
.,.,
|
349
369
|
|
350
|
-
module_eval(<<'.,.,', 'parser.racc',
|
370
|
+
module_eval(<<'.,.,', 'parser.racc', 41)
|
351
371
|
def _reduce_10(val, _values, result)
|
352
|
-
|
353
|
-
|
372
|
+
result = []
|
354
373
|
result
|
355
374
|
end
|
356
375
|
.,.,
|
357
376
|
|
358
|
-
module_eval(<<'.,.,', 'parser.racc',
|
377
|
+
module_eval(<<'.,.,', 'parser.racc', 42)
|
359
378
|
def _reduce_11(val, _values, result)
|
360
|
-
result =
|
379
|
+
result = val[0]
|
361
380
|
result
|
362
381
|
end
|
363
382
|
.,.,
|
364
383
|
|
365
|
-
module_eval(<<'.,.,', 'parser.racc',
|
384
|
+
module_eval(<<'.,.,', 'parser.racc', 44)
|
366
385
|
def _reduce_12(val, _values, result)
|
367
|
-
|
386
|
+
result = [RDL::Type::FiniteHashType.new(Hash[*val[0]])]
|
387
|
+
|
368
388
|
result
|
369
389
|
end
|
370
390
|
.,.,
|
371
391
|
|
372
392
|
module_eval(<<'.,.,', 'parser.racc', 47)
|
373
393
|
def _reduce_13(val, _values, result)
|
374
|
-
|
375
|
-
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2]])]
|
376
|
-
|
394
|
+
result = [val[0]]
|
377
395
|
result
|
378
396
|
end
|
379
397
|
.,.,
|
380
398
|
|
381
|
-
module_eval(<<'.,.,', 'parser.racc',
|
399
|
+
module_eval(<<'.,.,', 'parser.racc', 48)
|
382
400
|
def _reduce_14(val, _values, result)
|
383
|
-
result = val[0]
|
401
|
+
result = val[2].unshift val[0]
|
384
402
|
result
|
385
403
|
end
|
386
404
|
.,.,
|
387
405
|
|
388
|
-
module_eval(<<'.,.,', 'parser.racc',
|
406
|
+
module_eval(<<'.,.,', 'parser.racc', 49)
|
389
407
|
def _reduce_15(val, _values, result)
|
390
|
-
|
408
|
+
# named arg list must come last
|
409
|
+
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2]])]
|
410
|
+
|
391
411
|
result
|
392
412
|
end
|
393
413
|
.,.,
|
394
414
|
|
395
|
-
module_eval(<<'.,.,', 'parser.racc',
|
415
|
+
module_eval(<<'.,.,', 'parser.racc', 53)
|
396
416
|
def _reduce_16(val, _values, result)
|
397
417
|
result = val[0]
|
398
418
|
result
|
399
419
|
end
|
400
420
|
.,.,
|
401
421
|
|
402
|
-
module_eval(<<'.,.,', 'parser.racc',
|
422
|
+
module_eval(<<'.,.,', 'parser.racc', 54)
|
403
423
|
def _reduce_17(val, _values, result)
|
404
|
-
result = val[
|
424
|
+
result = RDL::Type::AnnotatedArgType.new(val[1], val[0])
|
405
425
|
result
|
406
426
|
end
|
407
427
|
.,.,
|
408
428
|
|
409
|
-
module_eval(<<'.,.,', 'parser.racc',
|
429
|
+
module_eval(<<'.,.,', 'parser.racc', 55)
|
410
430
|
def _reduce_18(val, _values, result)
|
411
|
-
result =
|
431
|
+
result = RDL::Type::DotsQuery.new
|
412
432
|
result
|
413
433
|
end
|
414
434
|
.,.,
|
415
435
|
|
416
|
-
module_eval(<<'.,.,', 'parser.racc',
|
436
|
+
module_eval(<<'.,.,', 'parser.racc', 57)
|
417
437
|
def _reduce_19(val, _values, result)
|
418
|
-
result =
|
438
|
+
result = val[0]
|
419
439
|
result
|
420
440
|
end
|
421
441
|
.,.,
|
422
442
|
|
423
|
-
module_eval(<<'.,.,', 'parser.racc',
|
443
|
+
module_eval(<<'.,.,', 'parser.racc', 58)
|
424
444
|
def _reduce_20(val, _values, result)
|
425
|
-
result =
|
445
|
+
result = val[0] + val[2]
|
426
446
|
result
|
427
447
|
end
|
428
448
|
.,.,
|
429
449
|
|
430
|
-
module_eval(<<'.,.,', 'parser.racc',
|
450
|
+
module_eval(<<'.,.,', 'parser.racc', 60)
|
431
451
|
def _reduce_21(val, _values, result)
|
432
|
-
result = val[0]
|
452
|
+
result = [val[0].to_sym, val[2]]
|
433
453
|
result
|
434
454
|
end
|
435
455
|
.,.,
|
436
456
|
|
437
|
-
module_eval(<<'.,.,', 'parser.racc',
|
457
|
+
module_eval(<<'.,.,', 'parser.racc', 63)
|
438
458
|
def _reduce_22(val, _values, result)
|
439
459
|
result = RDL::Type::OptionalType.new val[1]
|
440
460
|
result
|
441
461
|
end
|
442
462
|
.,.,
|
443
463
|
|
444
|
-
module_eval(<<'.,.,', 'parser.racc',
|
464
|
+
module_eval(<<'.,.,', 'parser.racc', 64)
|
445
465
|
def _reduce_23(val, _values, result)
|
446
|
-
result = val[
|
466
|
+
result = RDL::Type::VarargType.new val[1]
|
447
467
|
result
|
448
468
|
end
|
449
469
|
.,.,
|
450
470
|
|
451
|
-
module_eval(<<'.,.,', 'parser.racc',
|
471
|
+
module_eval(<<'.,.,', 'parser.racc', 65)
|
452
472
|
def _reduce_24(val, _values, result)
|
453
|
-
result =
|
473
|
+
result = val[0]
|
454
474
|
result
|
455
475
|
end
|
456
476
|
.,.,
|
457
477
|
|
458
|
-
module_eval(<<'.,.,', 'parser.racc',
|
478
|
+
module_eval(<<'.,.,', 'parser.racc', 67)
|
459
479
|
def _reduce_25(val, _values, result)
|
460
|
-
result = val[1]
|
480
|
+
result = RDL::Type::OptionalType.new val[1]
|
461
481
|
result
|
462
482
|
end
|
463
483
|
.,.,
|
464
484
|
|
465
|
-
module_eval(<<'.,.,', 'parser.racc',
|
485
|
+
module_eval(<<'.,.,', 'parser.racc', 68)
|
466
486
|
def _reduce_26(val, _values, result)
|
467
487
|
result = val[0]
|
468
488
|
result
|
469
489
|
end
|
470
490
|
.,.,
|
471
491
|
|
472
|
-
module_eval(<<'.,.,', 'parser.racc',
|
492
|
+
module_eval(<<'.,.,', 'parser.racc', 71)
|
473
493
|
def _reduce_27(val, _values, result)
|
494
|
+
result = nil
|
495
|
+
result
|
496
|
+
end
|
497
|
+
.,.,
|
498
|
+
|
499
|
+
module_eval(<<'.,.,', 'parser.racc', 72)
|
500
|
+
def _reduce_28(val, _values, result)
|
474
501
|
result = val[1]
|
475
502
|
result
|
476
503
|
end
|
477
504
|
.,.,
|
478
505
|
|
506
|
+
module_eval(<<'.,.,', 'parser.racc', 75)
|
507
|
+
def _reduce_29(val, _values, result)
|
508
|
+
result = val[0]
|
509
|
+
result
|
510
|
+
end
|
511
|
+
.,.,
|
512
|
+
|
479
513
|
module_eval(<<'.,.,', 'parser.racc', 76)
|
480
|
-
def
|
514
|
+
def _reduce_30(val, _values, result)
|
515
|
+
result = val[1]
|
516
|
+
result
|
517
|
+
end
|
518
|
+
.,.,
|
519
|
+
|
520
|
+
module_eval(<<'.,.,', 'parser.racc', 79)
|
521
|
+
def _reduce_31(val, _values, result)
|
481
522
|
result = [val[0]]
|
482
523
|
result
|
483
524
|
end
|
484
525
|
.,.,
|
485
526
|
|
486
|
-
module_eval(<<'.,.,', 'parser.racc',
|
487
|
-
def
|
527
|
+
module_eval(<<'.,.,', 'parser.racc', 80)
|
528
|
+
def _reduce_32(val, _values, result)
|
488
529
|
result = [val[0]] + val[2]
|
489
530
|
result
|
490
531
|
end
|
491
532
|
.,.,
|
492
533
|
|
493
|
-
# reduce
|
534
|
+
# reduce 33 omitted
|
494
535
|
|
495
|
-
module_eval(<<'.,.,', 'parser.racc',
|
496
|
-
def
|
536
|
+
module_eval(<<'.,.,', 'parser.racc', 83)
|
537
|
+
def _reduce_34(val, _values, result)
|
497
538
|
result = val[0]
|
498
539
|
result
|
499
540
|
end
|
500
541
|
.,.,
|
501
542
|
|
502
|
-
module_eval(<<'.,.,', 'parser.racc',
|
503
|
-
def
|
543
|
+
module_eval(<<'.,.,', 'parser.racc', 84)
|
544
|
+
def _reduce_35(val, _values, result)
|
504
545
|
result = [val[0].to_i, val[2]]
|
505
546
|
result
|
506
547
|
end
|
507
548
|
.,.,
|
508
549
|
|
509
|
-
module_eval(<<'.,.,', 'parser.racc',
|
510
|
-
def
|
550
|
+
module_eval(<<'.,.,', 'parser.racc', 85)
|
551
|
+
def _reduce_36(val, _values, result)
|
511
552
|
result = [val[0].to_f, val[2]]
|
512
553
|
result
|
513
554
|
end
|
514
555
|
.,.,
|
515
556
|
|
516
|
-
module_eval(<<'.,.,', 'parser.racc',
|
517
|
-
def
|
557
|
+
module_eval(<<'.,.,', 'parser.racc', 87)
|
558
|
+
def _reduce_37(val, _values, result)
|
518
559
|
result = [Kernel.const_get(val[0]), val[2]]
|
519
560
|
|
520
561
|
result
|
521
562
|
end
|
522
563
|
.,.,
|
523
564
|
|
524
|
-
module_eval(<<'.,.,', 'parser.racc',
|
525
|
-
def
|
565
|
+
module_eval(<<'.,.,', 'parser.racc', 89)
|
566
|
+
def _reduce_38(val, _values, result)
|
526
567
|
result = [val[0], val[2]]
|
527
568
|
result
|
528
569
|
end
|
529
570
|
.,.,
|
530
571
|
|
531
|
-
module_eval(<<'.,.,', 'parser.racc',
|
532
|
-
def
|
572
|
+
module_eval(<<'.,.,', 'parser.racc', 92)
|
573
|
+
def _reduce_39(val, _values, result)
|
533
574
|
result = val[0]
|
534
575
|
result
|
535
576
|
end
|
536
577
|
.,.,
|
537
578
|
|
538
|
-
module_eval(<<'.,.,', 'parser.racc',
|
539
|
-
def
|
579
|
+
module_eval(<<'.,.,', 'parser.racc', 93)
|
580
|
+
def _reduce_40(val, _values, result)
|
540
581
|
result = val[0] + val[2]
|
541
582
|
result
|
542
583
|
end
|
543
584
|
.,.,
|
544
585
|
|
545
|
-
module_eval(<<'.,.,', 'parser.racc',
|
546
|
-
def
|
586
|
+
module_eval(<<'.,.,', 'parser.racc', 96)
|
587
|
+
def _reduce_41(val, _values, result)
|
547
588
|
result = val[0]
|
548
589
|
result
|
549
590
|
end
|
550
591
|
.,.,
|
551
592
|
|
552
|
-
module_eval(<<'.,.,', 'parser.racc',
|
553
|
-
def
|
593
|
+
module_eval(<<'.,.,', 'parser.racc', 97)
|
594
|
+
def _reduce_42(val, _values, result)
|
554
595
|
result = RDL::Type::UnionType.new val[0], val[2]
|
555
596
|
result
|
556
597
|
end
|
557
598
|
.,.,
|
558
599
|
|
559
|
-
module_eval(<<'.,.,', 'parser.racc',
|
560
|
-
def
|
600
|
+
module_eval(<<'.,.,', 'parser.racc', 100)
|
601
|
+
def _reduce_43(val, _values, result)
|
561
602
|
result = RDL::Type::SingletonType.new(val[0].to_sym)
|
562
603
|
result
|
563
604
|
end
|
564
605
|
.,.,
|
565
606
|
|
566
|
-
module_eval(<<'.,.,', 'parser.racc',
|
567
|
-
def
|
607
|
+
module_eval(<<'.,.,', 'parser.racc', 102)
|
608
|
+
def _reduce_44(val, _values, result)
|
568
609
|
if val[0] == 'nil' then
|
569
610
|
result = RDL::Type::NilType.new
|
570
611
|
elsif val[0] =~ /^[a-z_]+\w*\'?/ then
|
@@ -577,8 +618,8 @@ module_eval(<<'.,.,', 'parser.racc', 99)
|
|
577
618
|
end
|
578
619
|
.,.,
|
579
620
|
|
580
|
-
module_eval(<<'.,.,', 'parser.racc',
|
581
|
-
def
|
621
|
+
module_eval(<<'.,.,', 'parser.racc', 111)
|
622
|
+
def _reduce_45(val, _values, result)
|
582
623
|
if $__rdl_special_types.has_key? val[0] then
|
583
624
|
result = $__rdl_special_types[val[0]]
|
584
625
|
else
|
@@ -589,8 +630,8 @@ module_eval(<<'.,.,', 'parser.racc', 108)
|
|
589
630
|
end
|
590
631
|
.,.,
|
591
632
|
|
592
|
-
module_eval(<<'.,.,', 'parser.racc',
|
593
|
-
def
|
633
|
+
module_eval(<<'.,.,', 'parser.racc', 118)
|
634
|
+
def _reduce_46(val, _values, result)
|
594
635
|
n = RDL::Type::NominalType.new(val[0])
|
595
636
|
result = RDL::Type::GenericType.new(n, *val[2])
|
596
637
|
|
@@ -598,52 +639,59 @@ module_eval(<<'.,.,', 'parser.racc', 115)
|
|
598
639
|
end
|
599
640
|
.,.,
|
600
641
|
|
601
|
-
module_eval(<<'.,.,', 'parser.racc',
|
602
|
-
def
|
642
|
+
module_eval(<<'.,.,', 'parser.racc', 122)
|
643
|
+
def _reduce_47(val, _values, result)
|
603
644
|
result = RDL::Type::TupleType.new(*val[1])
|
604
645
|
|
605
646
|
result
|
606
647
|
end
|
607
648
|
.,.,
|
608
649
|
|
609
|
-
module_eval(<<'.,.,', 'parser.racc',
|
610
|
-
def
|
650
|
+
module_eval(<<'.,.,', 'parser.racc', 125)
|
651
|
+
def _reduce_48(val, _values, result)
|
611
652
|
result = RDL::Type::StructuralType.new(Hash[*val[1]])
|
612
653
|
|
613
654
|
result
|
614
655
|
end
|
615
656
|
.,.,
|
616
657
|
|
617
|
-
module_eval(<<'.,.,', 'parser.racc',
|
618
|
-
def
|
658
|
+
module_eval(<<'.,.,', 'parser.racc', 128)
|
659
|
+
def _reduce_49(val, _values, result)
|
619
660
|
result = RDL::Type::FiniteHashType.new(Hash[*val[1]])
|
620
661
|
|
621
662
|
result
|
622
663
|
end
|
623
664
|
.,.,
|
624
665
|
|
625
|
-
module_eval(<<'.,.,', 'parser.racc',
|
626
|
-
def
|
666
|
+
module_eval(<<'.,.,', 'parser.racc', 130)
|
667
|
+
def _reduce_50(val, _values, result)
|
627
668
|
result = RDL::Type::SingletonType.new(val[0].to_i)
|
628
669
|
result
|
629
670
|
end
|
630
671
|
.,.,
|
631
672
|
|
632
|
-
module_eval(<<'.,.,', 'parser.racc',
|
633
|
-
def
|
673
|
+
module_eval(<<'.,.,', 'parser.racc', 131)
|
674
|
+
def _reduce_51(val, _values, result)
|
634
675
|
result = RDL::Type::SingletonType.new(val[0].to_f)
|
635
676
|
result
|
636
677
|
end
|
637
678
|
.,.,
|
638
679
|
|
639
|
-
module_eval(<<'.,.,', 'parser.racc',
|
640
|
-
def
|
680
|
+
module_eval(<<'.,.,', 'parser.racc', 133)
|
681
|
+
def _reduce_52(val, _values, result)
|
641
682
|
result = RDL::Type::SingletonType.new(Kernel.const_get(val[1]))
|
642
683
|
|
643
684
|
result
|
644
685
|
end
|
645
686
|
.,.,
|
646
687
|
|
688
|
+
module_eval(<<'.,.,', 'parser.racc', 137)
|
689
|
+
def _reduce_53(val, _values, result)
|
690
|
+
result = RDL::Type::WildQuery.new
|
691
|
+
result
|
692
|
+
end
|
693
|
+
.,.,
|
694
|
+
|
647
695
|
def _reduce_none(val, _values, result)
|
648
696
|
val[0]
|
649
697
|
end
|