rdl 2.0.0.rc4 → 2.0.0.rc5
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/README.md +56 -84
- data/lib/rdl/boot.rb +4 -0
- data/lib/rdl/boot_rails.rb +3 -1
- data/lib/rdl/contracts/flat.rb +1 -2
- data/lib/rdl/typecheck.rb +138 -27
- data/lib/rdl/types/annotated_arg.rb +8 -0
- data/lib/rdl/types/finite_hash.rb +32 -17
- data/lib/rdl/types/lexer.rex +1 -0
- data/lib/rdl/types/lexer.rex.rb +3 -0
- data/lib/rdl/types/method.rb +24 -4
- data/lib/rdl/types/optional.rb +8 -1
- data/lib/rdl/types/parser.racc +12 -9
- data/lib/rdl/types/parser.tab.rb +293 -255
- data/lib/rdl/types/type.rb +20 -11
- data/lib/rdl/types/union.rb +3 -0
- data/lib/rdl/types/vararg.rb +7 -2
- data/lib/rdl/wrap.rb +15 -2
- data/lib/types/core-ruby-2.x/proc.rb +16 -0
- data/lib/types/rails-5.x/_helpers.rb +20 -0
- data/lib/types/rails-5.x/active_model/errors.rb +15 -0
- data/lib/types/rails-5.x/active_model/validations.rb +5 -0
- data/lib/types/rails-5.x/active_record/associations.rb +190 -0
- data/lib/types/rails-5.x/active_record/core.rb +3 -0
- data/lib/types/rails-5.x/active_record/model_schema.rb +7 -10
- data/rdl.gemspec +2 -2
- data/test/test_le.rb +24 -0
- data/test/test_member.rb +24 -2
- data/test/test_parser.rb +21 -10
- data/test/test_query.rb +5 -2
- data/test/test_type_contract.rb +34 -2
- data/test/test_typecheck.rb +296 -36
- data/test/test_types.rb +8 -4
- metadata +7 -2
@@ -1,22 +1,25 @@
|
|
1
1
|
require_relative 'type'
|
2
2
|
|
3
3
|
module RDL::Type
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
4
|
+
# Type for finite maps from values to types; values are compared with ==.
|
5
|
+
# These are used for "named" arguments in Ruby, in which case the values are symbols.
|
6
|
+
# Finite hashes can also have a "rest" type (okay, they're not exactly finite in this case...)
|
7
|
+
# which is treated as a hash from Symbol to the type.
|
7
8
|
class FiniteHashType < Type
|
8
9
|
attr_reader :elts
|
10
|
+
attr_reader :rest
|
9
11
|
attr_reader :the_hash # either nil or hash type if self has been promoted to hash
|
10
12
|
attr_accessor :ubounds # upper bounds this tuple has been compared with using <=
|
11
13
|
attr_accessor :lbounds # lower bounds...
|
12
14
|
|
13
|
-
# [+elts+] is a map from keys to types
|
14
|
-
def initialize(elts)
|
15
|
+
# [+ elts +] is a map from keys to types
|
16
|
+
def initialize(elts, rest)
|
15
17
|
elts.each { |k, t|
|
16
18
|
raise RuntimeError, "Got #{t.inspect} where Type expected" unless t.is_a? Type
|
17
19
|
raise RuntimeError, "Type may not be annotated or vararg" if (t.instance_of? AnnotatedArgType) || (t.instance_of? VarargType)
|
18
20
|
}
|
19
21
|
@elts = elts
|
22
|
+
@rest = rest
|
20
23
|
@the_hash = nil
|
21
24
|
@cant_promote = false
|
22
25
|
@ubounds = []
|
@@ -31,14 +34,14 @@ module RDL::Type
|
|
31
34
|
|
32
35
|
def to_s
|
33
36
|
return @the_hash.to_s if @the_hash
|
34
|
-
"{" + @elts.map { |k, t| k.to_s + ": " + t.to_s }.join(', ') + "}"
|
37
|
+
return "{ " + @elts.map { |k, t| k.to_s + ": " + t.to_s }.join(', ') + (if @rest then ", **" + @rest.to_s else "" end) + " }"
|
35
38
|
end
|
36
39
|
|
37
40
|
def ==(other) # :nodoc:
|
38
41
|
return false if other.nil?
|
39
42
|
return (@the_hash == other) if @the_hash
|
40
43
|
other = other.canonical
|
41
|
-
return (other.instance_of? FiniteHashType) && (other.elts == @elts)
|
44
|
+
return (other.instance_of? FiniteHashType) && (other.elts == @elts) && (other.rest == @rest)
|
42
45
|
end
|
43
46
|
|
44
47
|
alias eql? ==
|
@@ -48,13 +51,22 @@ module RDL::Type
|
|
48
51
|
other = other.canonical
|
49
52
|
other = other.type if other.instance_of? AnnotatedArgType
|
50
53
|
return true if other.instance_of? WildQuery
|
54
|
+
return false unless ((@rest.nil? && other.rest.nil?) ||
|
55
|
+
(!@rest.nil? && !other.rest.nil? && @rest.match(other.rest)))
|
51
56
|
return (@elts.length == other.elts.length &&
|
52
57
|
@elts.all? { |k, v| (other.elts.has_key? k) && (v.match(other.elts[k]))})
|
53
58
|
end
|
54
59
|
|
55
60
|
def promote!
|
56
61
|
return false if @cant_promote
|
57
|
-
|
62
|
+
# TODO look at key types
|
63
|
+
domain_type = UnionType.new(*(@elts.keys.map { |k| NominalType.new(k.class) }))
|
64
|
+
range_type = UnionType.new(*@elts.values)
|
65
|
+
if @rest
|
66
|
+
domain_type = UnionType.new(domain_type, $__rdl_symbol_type)
|
67
|
+
range_type = UnionType.new(range_type, @rest)
|
68
|
+
end
|
69
|
+
@the_hash = GenericType.new($__rdl_hash_type, domain_type, range_type)
|
58
70
|
# same logic as Tuple
|
59
71
|
return (@lbounds.all? { |lbound| lbound <= self }) && (@ubounds.all? { |ubound| self <= ubound })
|
60
72
|
end
|
@@ -72,21 +84,24 @@ module RDL::Type
|
|
72
84
|
return @the_hash.member(obj, *args) if @the_hash
|
73
85
|
t = RDL::Util.rdl_type obj
|
74
86
|
return t <= self if t
|
75
|
-
|
87
|
+
right_elts = @elts.clone # shallow copy
|
76
88
|
|
77
89
|
return false unless obj.instance_of? Hash
|
78
90
|
|
79
91
|
# Check that every mapping in obj exists in @map and matches the type
|
80
92
|
obj.each_pair { |k, v|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
if @elts.has_key? k
|
94
|
+
t = @elts[k]
|
95
|
+
t = t.type if t.instance_of? OptionalType
|
96
|
+
return false unless t.member? v
|
97
|
+
right_elts.delete k
|
98
|
+
else
|
99
|
+
return false unless @rest && @rest.member?(v)
|
100
|
+
end
|
86
101
|
}
|
87
102
|
|
88
103
|
# Check that any remaining types are optional
|
89
|
-
|
104
|
+
right_elts.each_pair { |k, vt|
|
90
105
|
return false unless vt.instance_of? OptionalType
|
91
106
|
}
|
92
107
|
|
@@ -95,12 +110,12 @@ module RDL::Type
|
|
95
110
|
|
96
111
|
def instantiate(inst)
|
97
112
|
return @the_hash.instantiate(inst) if @the_hash
|
98
|
-
return FiniteHashType.new(Hash[@elts.map { |k, t| [k, t.instantiate(inst)] }])
|
113
|
+
return FiniteHashType.new(Hash[@elts.map { |k, t| [k, t.instantiate(inst)] }], (if @rest then @rest.instantiate(inst) end))
|
99
114
|
end
|
100
115
|
|
101
116
|
def hash
|
102
117
|
# note don't change hash value if @the_hash becomes non-nil
|
103
|
-
return 229 * @elts.hash
|
118
|
+
return 229 * @elts.hash * @rest.hash
|
104
119
|
end
|
105
120
|
end
|
106
121
|
end
|
data/lib/rdl/types/lexer.rex
CHANGED
data/lib/rdl/types/lexer.rex.rb
CHANGED
data/lib/rdl/types/method.rb
CHANGED
@@ -41,7 +41,11 @@ module RDL::Type
|
|
41
41
|
}
|
42
42
|
@args = *args
|
43
43
|
|
44
|
-
|
44
|
+
if block.instance_of? OptionalType
|
45
|
+
raise "Block must be MethodType" unless block.type.is_a? MethodType
|
46
|
+
else
|
47
|
+
raise "Block must be MethodType" unless (not block) or (block.instance_of? MethodType)
|
48
|
+
end
|
45
49
|
@block = block
|
46
50
|
|
47
51
|
raise "Attempt to create method type with non-type ret" unless ret.is_a? Type
|
@@ -61,8 +65,12 @@ module RDL::Type
|
|
61
65
|
check_arg_preds(bind, preds) if preds.size > 0
|
62
66
|
@args.each_with_index {|a,i| args[i] = block_wrap(slf, inst, a, bind, &args[i]) if a.is_a? MethodType }
|
63
67
|
if @block then
|
64
|
-
|
65
|
-
|
68
|
+
if @block.is_a? OptionalType
|
69
|
+
blk = block_wrap(slf, inst, @block.type.instantiate(inst), bind, &blk) if blk
|
70
|
+
else
|
71
|
+
next unless blk
|
72
|
+
blk = block_wrap(slf, inst, @block, bind, &blk)
|
73
|
+
end
|
66
74
|
elsif blk then
|
67
75
|
next
|
68
76
|
end
|
@@ -79,6 +87,16 @@ module RDL::Type
|
|
79
87
|
t = t.type.instantiate(inst)
|
80
88
|
if actual == args.size
|
81
89
|
states << [formal+1, actual] # skip to allow extra formal optionals at end
|
90
|
+
elsif t.is_a? MethodType
|
91
|
+
if args[actual].is_a? Proc
|
92
|
+
args[actual] = block_wrap(slf, inst, t, bind, &args[actual])
|
93
|
+
states << [formal+1, actual+1]
|
94
|
+
elsif args[actual].nil?
|
95
|
+
states << [formal+1, actual+1] # match
|
96
|
+
states << [formal+1, actual] # skip
|
97
|
+
else
|
98
|
+
states << [formal+1, actual]
|
99
|
+
end
|
82
100
|
elsif t.member?(args[actual], vars_wild: true)
|
83
101
|
states << [formal+1, actual+1] # match
|
84
102
|
states << [formal+1, actual] # skip
|
@@ -255,7 +273,9 @@ RUBY
|
|
255
273
|
end
|
256
274
|
|
257
275
|
def to_s # :nodoc:
|
258
|
-
if @block
|
276
|
+
if @block && @block.is_a?(OptionalType)
|
277
|
+
return "(#{@args.map { |arg| arg.to_s }.join(', ')}) #{@block.to_s} -> #{@ret.to_s}"
|
278
|
+
elsif @block
|
259
279
|
return "(#{@args.map { |arg| arg.to_s }.join(', ')}) {#{@block.to_s}} -> #{@ret.to_s}"
|
260
280
|
elsif @args
|
261
281
|
return "(#{@args.map { |arg| arg.to_s }.join(', ')}) -> #{@ret.to_s}"
|
data/lib/rdl/types/optional.rb
CHANGED
@@ -6,13 +6,16 @@ module RDL::Type
|
|
6
6
|
raise RuntimeError, "Attempt to create optional type with non-type" unless type.is_a? Type
|
7
7
|
raise "Can't have optional optional type" if type.is_a? OptionalType
|
8
8
|
raise "Can't have optional vararg type" if type.is_a? VarargType
|
9
|
+
raise "Can't have optional annotated type" if type.is_a? AnnotatedArgType
|
9
10
|
@type = type
|
10
11
|
super()
|
11
12
|
end
|
12
13
|
|
13
14
|
def to_s
|
14
|
-
if @type.
|
15
|
+
if @type.is_a? UnionType
|
15
16
|
"?(#{@type.to_s})"
|
17
|
+
elsif @type.is_a? MethodType
|
18
|
+
"?{ #{@type.to_s} }"
|
16
19
|
else
|
17
20
|
"?#{@type.to_s}"
|
18
21
|
end
|
@@ -42,5 +45,9 @@ module RDL::Type
|
|
42
45
|
def hash # :nodoc:
|
43
46
|
return 57 + @type.hash
|
44
47
|
end
|
48
|
+
|
49
|
+
def optional?
|
50
|
+
return true
|
51
|
+
end
|
45
52
|
end
|
46
53
|
end
|
data/lib/rdl/types/parser.racc
CHANGED
@@ -10,7 +10,7 @@ class Parser
|
|
10
10
|
token HASH_TYPE HASH_QUERY CONST_BEGIN RASSOC
|
11
11
|
token OR FIXNUM FLOAT COLON RARROW DOT DOTS ID SYMBOL SPECIAL_ID STRING PREDICATE
|
12
12
|
token LPAREN RPAREN LBRACE RBRACE LBRACKET RBRACKET
|
13
|
-
token COMMA QUERY BANG STAR LESS GREATER
|
13
|
+
token COMMA QUERY BANG STARSTAR STAR LESS GREATER
|
14
14
|
token EOF
|
15
15
|
|
16
16
|
rule
|
@@ -45,22 +45,23 @@ rule
|
|
45
45
|
{ result = [] }
|
46
46
|
| nonempty_arg_list { result = val[0] }
|
47
47
|
| named_arg_list {
|
48
|
-
result = [RDL::Type::FiniteHashType.new(Hash[*val[0]])]
|
48
|
+
result = [RDL::Type::FiniteHashType.new(Hash[*val[0][0]], val[0][1])]
|
49
49
|
}
|
50
50
|
nonempty_arg_list:
|
51
51
|
arg { result = [val[0]] }
|
52
52
|
| arg COMMA nonempty_arg_list { result = val[2].unshift val[0] }
|
53
53
|
| arg COMMA named_arg_list { # named arg list must come last
|
54
|
-
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2]])]
|
54
|
+
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2][0]], val[2][1])]
|
55
55
|
}
|
56
56
|
arg:
|
57
57
|
base_arg { result = val[0] }
|
58
|
-
| base_arg ID PREDICATE {result = RDL::Type::DependentArgType.new(val[1], val[0], val[2])}
|
58
|
+
| base_arg ID PREDICATE { result = RDL::Type::DependentArgType.new(val[1], val[0], val[2]) }
|
59
59
|
| base_arg ID { result = RDL::Type::AnnotatedArgType.new(val[1], val[0]) }
|
60
60
|
| DOTS { result = RDL::Type::DotsQuery.new }
|
61
61
|
named_arg_list:
|
62
|
-
named_arg { result = val[0] }
|
63
|
-
|
|
62
|
+
named_arg { result = [val[0], nil] }
|
63
|
+
| STARSTAR type_expr { result = [[], val[1]] }
|
64
|
+
| named_arg COMMA named_arg_list { result = [val[0] + val[2][0], val[2][1]] }
|
64
65
|
named_arg:
|
65
66
|
ID COLON base_arg_query_only { result = [val[0].to_sym, val[2]] }
|
66
67
|
|
@@ -75,6 +76,7 @@ rule
|
|
75
76
|
block:
|
76
77
|
{ result = nil }
|
77
78
|
| LBRACE method_type RBRACE { result = val[1] }
|
79
|
+
| QUERY LBRACE method_type RBRACE { result = RDL::Type::OptionalType.new val[2] }
|
78
80
|
|
79
81
|
type_expr:
|
80
82
|
union_type { result = val[0] }
|
@@ -94,8 +96,9 @@ rule
|
|
94
96
|
| STRING RASSOC union_type { result = [val[0], val[2]] } # strings are allowed as finite hash keys
|
95
97
|
|
96
98
|
hash_expr_comma_list:
|
97
|
-
hash_expr { result = val[0] }
|
98
|
-
|
|
99
|
+
hash_expr { result = [val[0], nil] }
|
100
|
+
| STARSTAR type_expr { result = [[], val[1]] }
|
101
|
+
| hash_expr COMMA hash_expr_comma_list { result = [val[0] + val[2][0], val[2][1]] }
|
99
102
|
|
100
103
|
union_type:
|
101
104
|
single_type { result = val[0] }
|
@@ -140,7 +143,7 @@ rule
|
|
140
143
|
result = RDL::Type::TupleType.new
|
141
144
|
}
|
142
145
|
| LBRACE hash_expr_comma_list RBRACE {
|
143
|
-
result = RDL::Type::FiniteHashType.new(Hash[*val[1]])
|
146
|
+
result = RDL::Type::FiniteHashType.new(Hash[*val[1][0]], val[1][1])
|
144
147
|
}
|
145
148
|
| FIXNUM { result = RDL::Type::SingletonType.new(val[0].to_i) }
|
146
149
|
| FLOAT { result = RDL::Type::SingletonType.new(val[0].to_f) }
|
data/lib/rdl/types/parser.tab.rb
CHANGED
@@ -11,7 +11,7 @@ module RDL::Type
|
|
11
11
|
|
12
12
|
class Parser < Racc::Parser
|
13
13
|
|
14
|
-
module_eval(<<'...end parser.racc/module_eval...', 'parser.racc',
|
14
|
+
module_eval(<<'...end parser.racc/module_eval...', 'parser.racc', 162)
|
15
15
|
|
16
16
|
def initialize()
|
17
17
|
@yydebug = true
|
@@ -21,198 +21,213 @@ end
|
|
21
21
|
##### State transition tables begin ###
|
22
22
|
|
23
23
|
racc_action_table = [
|
24
|
-
21,
|
25
|
-
|
26
|
-
|
27
|
-
16,
|
28
|
-
13,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
nil,
|
43
|
-
|
44
|
-
|
45
|
-
nil,
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
nil,
|
24
|
+
21, 71, 19, 20, 72, 22, 29, 32, 14, 16,
|
25
|
+
41, 73, 11, 69, 17, 62, 18, 77, 33, 13,
|
26
|
+
31, 34, 21, 31, 19, 20, 75, 22, 29, 32,
|
27
|
+
14, 16, 76, 40, 11, 40, 17, 62, 18, 78,
|
28
|
+
33, 13, 31, 34, 45, 79, 43, 44, 5, 6,
|
29
|
+
45, 41, 43, 44, 46, 83, 7, 41, 80, 84,
|
30
|
+
46, 81, 7, 67, 48, 87, 21, 65, 19, 20,
|
31
|
+
48, 22, 60, 15, 14, 16, 59, 93, 11, 58,
|
32
|
+
17, 21, 18, 19, 20, 13, 22, 57, 15, 14,
|
33
|
+
16, 96, 56, 11, 40, 17, 21, 18, 19, 20,
|
34
|
+
13, 22, 7, 15, 14, 16, 38, 101, 11, 7,
|
35
|
+
17, 21, 18, 19, 20, 13, 22, 103, 51, 14,
|
36
|
+
16, 36, 105, 11, 106, 17, 7, 18, 55, 21,
|
37
|
+
13, 19, 20, 108, 22, 7, 15, 14, 16, 8,
|
38
|
+
111, 113, 114, 17, 21, 18, 19, 20, 13, 22,
|
39
|
+
77, 15, 14, 16, 70, 115, nil, nil, 17, 21,
|
40
|
+
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
41
|
+
nil, nil, nil, 17, 21, 18, 19, 20, 13, 22,
|
42
|
+
nil, 15, 14, 16, nil, nil, nil, nil, 17, 21,
|
43
|
+
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
44
|
+
nil, 11, nil, 17, nil, 18, nil, 90, 13, 21,
|
45
|
+
nil, 19, 20, nil, 22, nil, 15, 14, 16, nil,
|
46
|
+
nil, 11, nil, 17, 21, 18, 19, 20, 13, 22,
|
47
|
+
nil, 15, 14, 16, nil, nil, 11, nil, 17, 21,
|
48
|
+
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
49
|
+
nil, nil, nil, 17, 21, 18, 19, 20, 13, 22,
|
50
|
+
nil, 15, 14, 16, nil, nil, 11, nil, 17, 21,
|
51
|
+
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
52
|
+
nil, 11, nil, 17, 21, 18, 19, 20, 13, 22,
|
53
|
+
nil, 15, 14, 16, nil, nil, 11, nil, 17, 21,
|
54
|
+
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
55
|
+
nil, 11, nil, 17, 21, 18, 19, 20, 13, 22,
|
56
|
+
nil, 15, 14, 16, nil, nil, nil, nil, 17, 21,
|
57
|
+
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
58
|
+
nil, 11, nil, 17, 21, 18, 19, 20, 13, 22,
|
59
|
+
nil, 15, 14, 16, nil, nil, nil, nil, 17, nil,
|
60
|
+
18 ]
|
57
61
|
|
58
62
|
racc_action_check = [
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
nil,
|
78
|
-
|
79
|
-
|
80
|
-
nil,
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
nil,
|
63
|
+
7, 45, 7, 7, 46, 7, 7, 7, 7, 7,
|
64
|
+
60, 47, 7, 43, 7, 32, 7, 51, 7, 7,
|
65
|
+
7, 7, 58, 60, 58, 58, 49, 58, 58, 58,
|
66
|
+
58, 58, 50, 32, 58, 51, 58, 41, 58, 52,
|
67
|
+
58, 58, 58, 58, 17, 53, 17, 17, 0, 0,
|
68
|
+
73, 17, 73, 73, 17, 57, 17, 73, 54, 57,
|
69
|
+
73, 56, 0, 39, 17, 59, 90, 37, 90, 90,
|
70
|
+
73, 90, 30, 90, 90, 90, 28, 68, 90, 27,
|
71
|
+
90, 11, 90, 11, 11, 90, 11, 24, 11, 11,
|
72
|
+
11, 71, 21, 11, 15, 11, 78, 11, 78, 78,
|
73
|
+
11, 78, 77, 78, 78, 78, 12, 82, 78, 83,
|
74
|
+
78, 18, 78, 18, 18, 78, 18, 84, 18, 18,
|
75
|
+
18, 8, 96, 18, 99, 18, 6, 18, 18, 72,
|
76
|
+
18, 72, 72, 102, 72, 103, 72, 72, 72, 1,
|
77
|
+
106, 107, 109, 72, 70, 72, 70, 70, 72, 70,
|
78
|
+
111, 70, 70, 70, 44, 113, nil, nil, 70, 69,
|
79
|
+
70, 69, 69, 70, 69, nil, 69, 69, 69, nil,
|
80
|
+
nil, nil, nil, 69, 67, 69, 67, 67, 69, 67,
|
81
|
+
nil, 67, 67, 67, nil, nil, nil, nil, 67, 62,
|
82
|
+
67, 62, 62, 67, 62, nil, 62, 62, 62, nil,
|
83
|
+
nil, 62, nil, 62, nil, 62, nil, 62, 62, 31,
|
84
|
+
nil, 31, 31, nil, 31, nil, 31, 31, 31, nil,
|
85
|
+
nil, 31, nil, 31, 48, 31, 48, 48, 31, 48,
|
86
|
+
nil, 48, 48, 48, nil, nil, 48, nil, 48, 105,
|
87
|
+
48, 105, 105, 48, 105, nil, 105, 105, 105, nil,
|
88
|
+
nil, nil, nil, 105, 5, 105, 5, 5, 105, 5,
|
89
|
+
nil, 5, 5, 5, nil, nil, 5, nil, 5, 101,
|
90
|
+
5, 101, 101, 5, 101, nil, 101, 101, 101, nil,
|
91
|
+
nil, 101, nil, 101, 33, 101, 33, 33, 101, 33,
|
92
|
+
nil, 33, 33, 33, nil, nil, 33, nil, 33, 34,
|
93
|
+
33, 34, 34, 33, 34, nil, 34, 34, 34, nil,
|
94
|
+
nil, 34, nil, 34, 38, 34, 38, 38, 34, 38,
|
95
|
+
nil, 38, 38, 38, nil, nil, nil, nil, 38, 40,
|
96
|
+
38, 40, 40, 38, 40, nil, 40, 40, 40, nil,
|
97
|
+
nil, 40, nil, 40, 13, 40, 13, 13, 40, 13,
|
98
|
+
nil, 13, 13, 13, nil, nil, nil, nil, 13, nil,
|
99
|
+
13 ]
|
92
100
|
|
93
101
|
racc_action_pointer = [
|
94
|
-
|
95
|
-
nil,
|
96
|
-
nil,
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
nil, nil, nil, nil,
|
101
|
-
|
102
|
-
nil, nil,
|
103
|
-
nil,
|
104
|
-
|
102
|
+
43, 139, nil, nil, nil, 247, 107, -7, 121, nil,
|
103
|
+
nil, 74, 102, 337, nil, 65, nil, 37, 104, nil,
|
104
|
+
nil, 78, nil, nil, 67, nil, nil, 77, 62, nil,
|
105
|
+
70, 202, 4, 277, 292, nil, nil, 47, 307, 59,
|
106
|
+
322, 26, nil, 5, 146, -13, -4, 9, 217, 4,
|
107
|
+
10, 6, 37, 21, 34, nil, 39, 34, 15, 47,
|
108
|
+
-4, nil, 182, nil, nil, nil, nil, 167, 47, 152,
|
109
|
+
137, 69, 122, 43, nil, nil, nil, 83, 89, nil,
|
110
|
+
nil, nil, 104, 90, 96, nil, nil, nil, nil, nil,
|
111
|
+
59, nil, nil, nil, nil, nil, 114, nil, nil, 122,
|
112
|
+
nil, 262, 111, 116, nil, 232, 126, 127, nil, 120,
|
113
|
+
nil, 139, nil, 137, nil, nil ]
|
105
114
|
|
106
115
|
racc_action_default = [
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-21, -
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
-
|
116
|
-
-
|
117
|
-
-
|
116
|
+
-63, -63, -1, -2, -3, -63, -63, -11, -63, -4,
|
117
|
+
-33, -63, -46, -63, -50, -51, -52, -37, -63, -59,
|
118
|
+
-60, -63, -62, -5, -63, -12, -13, -14, -17, -20,
|
119
|
+
-21, -63, -51, -63, -63, -27, 116, -63, -63, -48,
|
120
|
+
-63, -63, -38, -63, -63, -63, -63, -43, -63, -63,
|
121
|
+
-63, -51, -35, -63, -63, -57, -63, -30, -63, -19,
|
122
|
+
-63, -22, -63, -25, -26, -34, -47, -63, -63, -63,
|
123
|
+
-63, -63, -63, -37, -44, -54, -58, -63, -63, -55,
|
124
|
+
-56, -61, -63, -63, -63, -15, -16, -18, -23, -24,
|
125
|
+
-63, -29, -49, -53, -39, -40, -63, -42, -45, -9,
|
126
|
+
-36, -63, -63, -63, -28, -63, -63, -6, -31, -63,
|
127
|
+
-41, -63, -10, -7, -32, -8 ]
|
118
128
|
|
119
129
|
racc_goto_table = [
|
120
|
-
9,
|
121
|
-
|
122
|
-
|
123
|
-
nil,
|
124
|
-
nil, nil, nil, nil,
|
125
|
-
nil,
|
126
|
-
|
127
|
-
nil, nil, nil, nil, nil, nil,
|
128
|
-
|
129
|
-
nil,
|
130
|
+
2, 9, 54, 35, 66, 50, 23, 37, 42, 53,
|
131
|
+
39, 25, 26, 3, 4, 24, 82, 49, 89, 1,
|
132
|
+
nil, nil, nil, nil, nil, nil, nil, 61, nil, 63,
|
133
|
+
64, 68, nil, 92, nil, 94, 95, nil, 97, nil,
|
134
|
+
nil, nil, nil, nil, 74, nil, nil, nil, nil, nil,
|
135
|
+
nil, nil, nil, nil, 35, nil, nil, nil, 91, nil,
|
136
|
+
nil, 98, 85, 86, 42, 88, nil, nil, nil, 100,
|
137
|
+
nil, 110, nil, nil, nil, nil, nil, 99, nil, nil,
|
138
|
+
nil, nil, nil, 102, nil, nil, 104, nil, nil, nil,
|
139
|
+
112, nil, nil, nil, nil, nil, nil, 107, nil, nil,
|
140
|
+
nil, nil, nil, 109 ]
|
130
141
|
|
131
142
|
racc_goto_check = [
|
132
|
-
5, 8, 5,
|
133
|
-
|
134
|
-
|
135
|
-
nil, 15, nil, 15, 15, nil, 15, nil,
|
136
|
-
nil, nil, nil, nil,
|
137
|
-
nil,
|
138
|
-
|
139
|
-
nil, nil, nil, nil, nil, nil, 2, nil, nil,
|
140
|
-
|
141
|
-
nil, 5
|
143
|
+
2, 5, 8, 5, 15, 18, 2, 5, 13, 16,
|
144
|
+
19, 9, 10, 3, 4, 6, 7, 2, 14, 1,
|
145
|
+
nil, nil, nil, nil, nil, nil, nil, 5, nil, 5,
|
146
|
+
5, 16, nil, 15, nil, 15, 15, nil, 15, nil,
|
147
|
+
nil, nil, nil, nil, 5, nil, nil, nil, nil, nil,
|
148
|
+
nil, nil, nil, nil, 5, nil, nil, nil, 5, nil,
|
149
|
+
nil, 18, 9, 10, 13, 10, nil, nil, nil, 16,
|
150
|
+
nil, 15, nil, nil, nil, nil, nil, 2, nil, nil,
|
151
|
+
nil, nil, nil, 2, nil, nil, 5, nil, nil, nil,
|
152
|
+
8, nil, nil, nil, nil, nil, nil, 5, nil, nil,
|
153
|
+
nil, nil, nil, 2 ]
|
142
154
|
|
143
155
|
racc_goto_pointer = [
|
144
|
-
nil,
|
145
|
-
|
156
|
+
nil, 19, 0, 13, 14, -4, 8, -41, -16, 4,
|
157
|
+
5, nil, nil, -9, -44, -34, -9, nil, -12, -3 ]
|
146
158
|
|
147
159
|
racc_goto_default = [
|
148
|
-
nil, nil, nil, nil, nil,
|
149
|
-
nil, 27, 28, 30, nil, 10, nil,
|
160
|
+
nil, nil, nil, nil, nil, 52, nil, nil, nil, nil,
|
161
|
+
nil, 27, 28, 30, nil, 10, nil, 47, nil, 12 ]
|
150
162
|
|
151
163
|
racc_reduce_table = [
|
152
164
|
0, 0, :racc_error,
|
153
|
-
1,
|
154
|
-
1,
|
155
|
-
1,
|
156
|
-
2,
|
157
|
-
2,
|
158
|
-
6,
|
159
|
-
7,
|
160
|
-
8,
|
161
|
-
3,
|
162
|
-
5,
|
163
|
-
0,
|
164
|
-
1,
|
165
|
-
1,
|
166
|
-
1,
|
167
|
-
3,
|
168
|
-
3,
|
169
|
-
1,
|
170
|
-
3,
|
171
|
-
2,
|
172
|
-
1,
|
173
|
-
1,
|
174
|
-
|
175
|
-
3,
|
176
|
-
|
177
|
-
2,
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
1,
|
186
|
-
3,
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
3,
|
193
|
-
|
165
|
+
1, 33, :_reduce_1,
|
166
|
+
1, 33, :_reduce_2,
|
167
|
+
1, 33, :_reduce_3,
|
168
|
+
2, 35, :_reduce_4,
|
169
|
+
2, 36, :_reduce_5,
|
170
|
+
6, 34, :_reduce_6,
|
171
|
+
7, 34, :_reduce_7,
|
172
|
+
8, 34, :_reduce_8,
|
173
|
+
3, 40, :_reduce_9,
|
174
|
+
5, 40, :_reduce_10,
|
175
|
+
0, 38, :_reduce_11,
|
176
|
+
1, 38, :_reduce_12,
|
177
|
+
1, 38, :_reduce_13,
|
178
|
+
1, 41, :_reduce_14,
|
179
|
+
3, 41, :_reduce_15,
|
180
|
+
3, 41, :_reduce_16,
|
181
|
+
1, 43, :_reduce_17,
|
182
|
+
3, 43, :_reduce_18,
|
183
|
+
2, 43, :_reduce_19,
|
184
|
+
1, 43, :_reduce_20,
|
185
|
+
1, 42, :_reduce_21,
|
186
|
+
2, 42, :_reduce_22,
|
187
|
+
3, 42, :_reduce_23,
|
188
|
+
3, 45, :_reduce_24,
|
189
|
+
2, 44, :_reduce_25,
|
190
|
+
2, 44, :_reduce_26,
|
191
|
+
1, 44, :_reduce_27,
|
192
|
+
2, 46, :_reduce_28,
|
193
|
+
1, 46, :_reduce_29,
|
194
|
+
0, 39, :_reduce_30,
|
195
|
+
3, 39, :_reduce_31,
|
196
|
+
4, 39, :_reduce_32,
|
197
|
+
1, 37, :_reduce_33,
|
198
|
+
3, 37, :_reduce_34,
|
199
|
+
1, 48, :_reduce_35,
|
200
|
+
3, 48, :_reduce_36,
|
201
|
+
0, 49, :_reduce_none,
|
202
|
+
1, 49, :_reduce_38,
|
203
|
+
3, 49, :_reduce_39,
|
204
|
+
3, 49, :_reduce_40,
|
205
|
+
5, 49, :_reduce_41,
|
194
206
|
3, 49, :_reduce_42,
|
195
|
-
1,
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
3,
|
208
|
-
|
209
|
-
|
210
|
-
3,
|
211
|
-
1,
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
207
|
+
1, 50, :_reduce_43,
|
208
|
+
2, 50, :_reduce_44,
|
209
|
+
3, 50, :_reduce_45,
|
210
|
+
1, 47, :_reduce_46,
|
211
|
+
3, 47, :_reduce_47,
|
212
|
+
2, 47, :_reduce_48,
|
213
|
+
4, 47, :_reduce_49,
|
214
|
+
1, 51, :_reduce_50,
|
215
|
+
1, 51, :_reduce_51,
|
216
|
+
1, 51, :_reduce_52,
|
217
|
+
4, 51, :_reduce_53,
|
218
|
+
3, 51, :_reduce_54,
|
219
|
+
3, 51, :_reduce_55,
|
220
|
+
3, 51, :_reduce_56,
|
221
|
+
2, 51, :_reduce_57,
|
222
|
+
3, 51, :_reduce_58,
|
223
|
+
1, 51, :_reduce_59,
|
224
|
+
1, 51, :_reduce_60,
|
225
|
+
3, 51, :_reduce_61,
|
226
|
+
1, 51, :_reduce_62 ]
|
227
|
+
|
228
|
+
racc_reduce_n = 63
|
229
|
+
|
230
|
+
racc_shift_n = 116
|
216
231
|
|
217
232
|
racc_token_table = {
|
218
233
|
false => 0,
|
@@ -242,12 +257,13 @@ racc_token_table = {
|
|
242
257
|
:RBRACKET => 24,
|
243
258
|
:QUERY => 25,
|
244
259
|
:BANG => 26,
|
245
|
-
:
|
246
|
-
:
|
247
|
-
:
|
248
|
-
:
|
260
|
+
:STARSTAR => 27,
|
261
|
+
:STAR => 28,
|
262
|
+
:LESS => 29,
|
263
|
+
:GREATER => 30,
|
264
|
+
:EOF => 31 }
|
249
265
|
|
250
|
-
racc_nt_base =
|
266
|
+
racc_nt_base = 32
|
251
267
|
|
252
268
|
racc_use_result_var = true
|
253
269
|
|
@@ -295,6 +311,7 @@ Racc_token_to_s_table = [
|
|
295
311
|
"RBRACKET",
|
296
312
|
"QUERY",
|
297
313
|
"BANG",
|
314
|
+
"STARSTAR",
|
298
315
|
"STAR",
|
299
316
|
"LESS",
|
300
317
|
"GREATER",
|
@@ -415,7 +432,7 @@ module_eval(<<'.,.,', 'parser.racc', 45)
|
|
415
432
|
|
416
433
|
module_eval(<<'.,.,', 'parser.racc', 47)
|
417
434
|
def _reduce_13(val, _values, result)
|
418
|
-
result = [RDL::Type::FiniteHashType.new(Hash[*val[0]])]
|
435
|
+
result = [RDL::Type::FiniteHashType.new(Hash[*val[0][0]], val[0][1])]
|
419
436
|
|
420
437
|
result
|
421
438
|
end
|
@@ -438,7 +455,7 @@ module_eval(<<'.,.,', 'parser.racc', 51)
|
|
438
455
|
module_eval(<<'.,.,', 'parser.racc', 52)
|
439
456
|
def _reduce_16(val, _values, result)
|
440
457
|
# named arg list must come last
|
441
|
-
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2]])]
|
458
|
+
result = [val[0], RDL::Type::FiniteHashType.new(Hash[*val[2][0]], val[2][1])]
|
442
459
|
|
443
460
|
result
|
444
461
|
end
|
@@ -453,7 +470,7 @@ module_eval(<<'.,.,', 'parser.racc', 56)
|
|
453
470
|
|
454
471
|
module_eval(<<'.,.,', 'parser.racc', 57)
|
455
472
|
def _reduce_18(val, _values, result)
|
456
|
-
|
473
|
+
result = RDL::Type::DependentArgType.new(val[1], val[0], val[2])
|
457
474
|
result
|
458
475
|
end
|
459
476
|
.,.,
|
@@ -474,191 +491,212 @@ module_eval(<<'.,.,', 'parser.racc', 59)
|
|
474
491
|
|
475
492
|
module_eval(<<'.,.,', 'parser.racc', 61)
|
476
493
|
def _reduce_21(val, _values, result)
|
477
|
-
result = val[0]
|
494
|
+
result = [val[0], nil]
|
478
495
|
result
|
479
496
|
end
|
480
497
|
.,.,
|
481
498
|
|
482
499
|
module_eval(<<'.,.,', 'parser.racc', 62)
|
483
500
|
def _reduce_22(val, _values, result)
|
484
|
-
result =
|
501
|
+
result = [[], val[1]]
|
485
502
|
result
|
486
503
|
end
|
487
504
|
.,.,
|
488
505
|
|
489
|
-
module_eval(<<'.,.,', 'parser.racc',
|
506
|
+
module_eval(<<'.,.,', 'parser.racc', 63)
|
490
507
|
def _reduce_23(val, _values, result)
|
491
|
-
result = [val[0]
|
508
|
+
result = [val[0] + val[2][0], val[2][1]]
|
492
509
|
result
|
493
510
|
end
|
494
511
|
.,.,
|
495
512
|
|
496
|
-
module_eval(<<'.,.,', 'parser.racc',
|
513
|
+
module_eval(<<'.,.,', 'parser.racc', 65)
|
497
514
|
def _reduce_24(val, _values, result)
|
498
|
-
result =
|
515
|
+
result = [val[0].to_sym, val[2]]
|
499
516
|
result
|
500
517
|
end
|
501
518
|
.,.,
|
502
519
|
|
503
520
|
module_eval(<<'.,.,', 'parser.racc', 68)
|
504
521
|
def _reduce_25(val, _values, result)
|
505
|
-
result = RDL::Type::
|
522
|
+
result = RDL::Type::OptionalType.new val[1]
|
506
523
|
result
|
507
524
|
end
|
508
525
|
.,.,
|
509
526
|
|
510
527
|
module_eval(<<'.,.,', 'parser.racc', 69)
|
511
528
|
def _reduce_26(val, _values, result)
|
512
|
-
result = val[
|
529
|
+
result = RDL::Type::VarargType.new val[1]
|
513
530
|
result
|
514
531
|
end
|
515
532
|
.,.,
|
516
533
|
|
517
|
-
module_eval(<<'.,.,', 'parser.racc',
|
534
|
+
module_eval(<<'.,.,', 'parser.racc', 70)
|
518
535
|
def _reduce_27(val, _values, result)
|
519
|
-
result =
|
536
|
+
result = val[0]
|
520
537
|
result
|
521
538
|
end
|
522
539
|
.,.,
|
523
540
|
|
524
541
|
module_eval(<<'.,.,', 'parser.racc', 72)
|
525
542
|
def _reduce_28(val, _values, result)
|
526
|
-
result = val[
|
543
|
+
result = RDL::Type::OptionalType.new val[1]
|
527
544
|
result
|
528
545
|
end
|
529
546
|
.,.,
|
530
547
|
|
531
|
-
module_eval(<<'.,.,', 'parser.racc',
|
548
|
+
module_eval(<<'.,.,', 'parser.racc', 73)
|
532
549
|
def _reduce_29(val, _values, result)
|
533
|
-
result =
|
550
|
+
result = val[0]
|
534
551
|
result
|
535
552
|
end
|
536
553
|
.,.,
|
537
554
|
|
538
555
|
module_eval(<<'.,.,', 'parser.racc', 76)
|
539
556
|
def _reduce_30(val, _values, result)
|
540
|
-
result =
|
557
|
+
result = nil
|
541
558
|
result
|
542
559
|
end
|
543
560
|
.,.,
|
544
561
|
|
545
|
-
module_eval(<<'.,.,', 'parser.racc',
|
562
|
+
module_eval(<<'.,.,', 'parser.racc', 77)
|
546
563
|
def _reduce_31(val, _values, result)
|
547
|
-
result = val[
|
564
|
+
result = val[1]
|
548
565
|
result
|
549
566
|
end
|
550
567
|
.,.,
|
551
568
|
|
552
|
-
module_eval(<<'.,.,', 'parser.racc',
|
569
|
+
module_eval(<<'.,.,', 'parser.racc', 78)
|
553
570
|
def _reduce_32(val, _values, result)
|
554
|
-
result = val[
|
571
|
+
result = RDL::Type::OptionalType.new val[2]
|
555
572
|
result
|
556
573
|
end
|
557
574
|
.,.,
|
558
575
|
|
559
|
-
module_eval(<<'.,.,', 'parser.racc',
|
576
|
+
module_eval(<<'.,.,', 'parser.racc', 81)
|
560
577
|
def _reduce_33(val, _values, result)
|
561
|
-
result =
|
578
|
+
result = val[0]
|
562
579
|
result
|
563
580
|
end
|
564
581
|
.,.,
|
565
582
|
|
566
|
-
module_eval(<<'.,.,', 'parser.racc',
|
583
|
+
module_eval(<<'.,.,', 'parser.racc', 82)
|
567
584
|
def _reduce_34(val, _values, result)
|
568
|
-
result =
|
585
|
+
result = val[1]
|
569
586
|
result
|
570
587
|
end
|
571
588
|
.,.,
|
572
589
|
|
573
|
-
|
590
|
+
module_eval(<<'.,.,', 'parser.racc', 85)
|
591
|
+
def _reduce_35(val, _values, result)
|
592
|
+
result = [val[0]]
|
593
|
+
result
|
594
|
+
end
|
595
|
+
.,.,
|
574
596
|
|
575
|
-
module_eval(<<'.,.,', 'parser.racc',
|
597
|
+
module_eval(<<'.,.,', 'parser.racc', 86)
|
576
598
|
def _reduce_36(val, _values, result)
|
599
|
+
result = [val[0]] + val[2]
|
600
|
+
result
|
601
|
+
end
|
602
|
+
.,.,
|
603
|
+
|
604
|
+
# reduce 37 omitted
|
605
|
+
|
606
|
+
module_eval(<<'.,.,', 'parser.racc', 89)
|
607
|
+
def _reduce_38(val, _values, result)
|
577
608
|
result = val[0]
|
578
609
|
result
|
579
610
|
end
|
580
611
|
.,.,
|
581
612
|
|
582
|
-
module_eval(<<'.,.,', 'parser.racc',
|
583
|
-
def
|
613
|
+
module_eval(<<'.,.,', 'parser.racc', 90)
|
614
|
+
def _reduce_39(val, _values, result)
|
584
615
|
result = [val[0].to_i, val[2]]
|
585
616
|
result
|
586
617
|
end
|
587
618
|
.,.,
|
588
619
|
|
589
|
-
module_eval(<<'.,.,', 'parser.racc',
|
590
|
-
def
|
620
|
+
module_eval(<<'.,.,', 'parser.racc', 91)
|
621
|
+
def _reduce_40(val, _values, result)
|
591
622
|
result = [val[0].to_f, val[2]]
|
592
623
|
result
|
593
624
|
end
|
594
625
|
.,.,
|
595
626
|
|
596
|
-
module_eval(<<'.,.,', 'parser.racc',
|
597
|
-
def
|
627
|
+
module_eval(<<'.,.,', 'parser.racc', 93)
|
628
|
+
def _reduce_41(val, _values, result)
|
598
629
|
result = [Kernel.const_get(val[0]), val[2]]
|
599
630
|
|
600
631
|
result
|
601
632
|
end
|
602
633
|
.,.,
|
603
634
|
|
604
|
-
module_eval(<<'.,.,', 'parser.racc',
|
605
|
-
def
|
635
|
+
module_eval(<<'.,.,', 'parser.racc', 95)
|
636
|
+
def _reduce_42(val, _values, result)
|
606
637
|
result = [val[0], val[2]]
|
607
638
|
result
|
608
639
|
end
|
609
640
|
.,.,
|
610
641
|
|
611
|
-
module_eval(<<'.,.,', 'parser.racc',
|
612
|
-
def
|
613
|
-
result = val[0]
|
642
|
+
module_eval(<<'.,.,', 'parser.racc', 98)
|
643
|
+
def _reduce_43(val, _values, result)
|
644
|
+
result = [val[0], nil]
|
614
645
|
result
|
615
646
|
end
|
616
647
|
.,.,
|
617
648
|
|
618
|
-
module_eval(<<'.,.,', 'parser.racc',
|
619
|
-
def
|
620
|
-
result =
|
649
|
+
module_eval(<<'.,.,', 'parser.racc', 99)
|
650
|
+
def _reduce_44(val, _values, result)
|
651
|
+
result = [[], val[1]]
|
621
652
|
result
|
622
653
|
end
|
623
654
|
.,.,
|
624
655
|
|
625
656
|
module_eval(<<'.,.,', 'parser.racc', 100)
|
626
|
-
def
|
657
|
+
def _reduce_45(val, _values, result)
|
658
|
+
result = [val[0] + val[2][0], val[2][1]]
|
659
|
+
result
|
660
|
+
end
|
661
|
+
.,.,
|
662
|
+
|
663
|
+
module_eval(<<'.,.,', 'parser.racc', 103)
|
664
|
+
def _reduce_46(val, _values, result)
|
627
665
|
result = val[0]
|
628
666
|
result
|
629
667
|
end
|
630
668
|
.,.,
|
631
669
|
|
632
|
-
module_eval(<<'.,.,', 'parser.racc',
|
633
|
-
def
|
670
|
+
module_eval(<<'.,.,', 'parser.racc', 104)
|
671
|
+
def _reduce_47(val, _values, result)
|
634
672
|
result = RDL::Type::UnionType.new val[0], val[2]
|
635
673
|
result
|
636
674
|
end
|
637
675
|
.,.,
|
638
676
|
|
639
|
-
module_eval(<<'.,.,', 'parser.racc',
|
640
|
-
def
|
677
|
+
module_eval(<<'.,.,', 'parser.racc', 105)
|
678
|
+
def _reduce_48(val, _values, result)
|
641
679
|
result = RDL::Type::NonNullType.new val[1]
|
642
680
|
result
|
643
681
|
end
|
644
682
|
.,.,
|
645
683
|
|
646
|
-
module_eval(<<'.,.,', 'parser.racc',
|
647
|
-
def
|
684
|
+
module_eval(<<'.,.,', 'parser.racc', 106)
|
685
|
+
def _reduce_49(val, _values, result)
|
648
686
|
result = RDL::Type::UnionType.new(RDL::Type::NonNullType.new(val[1]), val[3])
|
649
687
|
result
|
650
688
|
end
|
651
689
|
.,.,
|
652
690
|
|
653
|
-
module_eval(<<'.,.,', 'parser.racc',
|
654
|
-
def
|
691
|
+
module_eval(<<'.,.,', 'parser.racc', 109)
|
692
|
+
def _reduce_50(val, _values, result)
|
655
693
|
result = RDL::Type::SingletonType.new(val[0].to_sym)
|
656
694
|
result
|
657
695
|
end
|
658
696
|
.,.,
|
659
697
|
|
660
|
-
module_eval(<<'.,.,', 'parser.racc',
|
661
|
-
def
|
698
|
+
module_eval(<<'.,.,', 'parser.racc', 111)
|
699
|
+
def _reduce_51(val, _values, result)
|
662
700
|
if val[0] == 'nil' then
|
663
701
|
result = $__rdl_nil_type
|
664
702
|
elsif val[0] == 'true' then
|
@@ -675,8 +713,8 @@ module_eval(<<'.,.,', 'parser.racc', 108)
|
|
675
713
|
end
|
676
714
|
.,.,
|
677
715
|
|
678
|
-
module_eval(<<'.,.,', 'parser.racc',
|
679
|
-
def
|
716
|
+
module_eval(<<'.,.,', 'parser.racc', 124)
|
717
|
+
def _reduce_52(val, _values, result)
|
680
718
|
if $__rdl_special_types.has_key? val[0] then
|
681
719
|
result = $__rdl_special_types[val[0]]
|
682
720
|
else
|
@@ -687,8 +725,8 @@ module_eval(<<'.,.,', 'parser.racc', 121)
|
|
687
725
|
end
|
688
726
|
.,.,
|
689
727
|
|
690
|
-
module_eval(<<'.,.,', 'parser.racc',
|
691
|
-
def
|
728
|
+
module_eval(<<'.,.,', 'parser.racc', 131)
|
729
|
+
def _reduce_53(val, _values, result)
|
692
730
|
n = RDL::Type::NominalType.new(val[0])
|
693
731
|
result = RDL::Type::GenericType.new(n, *val[2])
|
694
732
|
|
@@ -696,69 +734,69 @@ module_eval(<<'.,.,', 'parser.racc', 128)
|
|
696
734
|
end
|
697
735
|
.,.,
|
698
736
|
|
699
|
-
module_eval(<<'.,.,', 'parser.racc',
|
700
|
-
def
|
737
|
+
module_eval(<<'.,.,', 'parser.racc', 134)
|
738
|
+
def _reduce_54(val, _values, result)
|
701
739
|
result = val[1]
|
702
740
|
result
|
703
741
|
end
|
704
742
|
.,.,
|
705
743
|
|
706
|
-
module_eval(<<'.,.,', 'parser.racc',
|
707
|
-
def
|
744
|
+
module_eval(<<'.,.,', 'parser.racc', 136)
|
745
|
+
def _reduce_55(val, _values, result)
|
708
746
|
result = RDL::Type::TupleType.new(*val[1])
|
709
747
|
|
710
748
|
result
|
711
749
|
end
|
712
750
|
.,.,
|
713
751
|
|
714
|
-
module_eval(<<'.,.,', 'parser.racc',
|
715
|
-
def
|
752
|
+
module_eval(<<'.,.,', 'parser.racc', 139)
|
753
|
+
def _reduce_56(val, _values, result)
|
716
754
|
result = RDL::Type::StructuralType.new(Hash[*val[1]])
|
717
755
|
|
718
756
|
result
|
719
757
|
end
|
720
758
|
.,.,
|
721
759
|
|
722
|
-
module_eval(<<'.,.,', 'parser.racc',
|
723
|
-
def
|
760
|
+
module_eval(<<'.,.,', 'parser.racc', 142)
|
761
|
+
def _reduce_57(val, _values, result)
|
724
762
|
result = RDL::Type::TupleType.new
|
725
763
|
|
726
764
|
result
|
727
765
|
end
|
728
766
|
.,.,
|
729
767
|
|
730
|
-
module_eval(<<'.,.,', 'parser.racc',
|
731
|
-
def
|
732
|
-
result = RDL::Type::FiniteHashType.new(Hash[*val[1]])
|
768
|
+
module_eval(<<'.,.,', 'parser.racc', 145)
|
769
|
+
def _reduce_58(val, _values, result)
|
770
|
+
result = RDL::Type::FiniteHashType.new(Hash[*val[1][0]], val[1][1])
|
733
771
|
|
734
772
|
result
|
735
773
|
end
|
736
774
|
.,.,
|
737
775
|
|
738
|
-
module_eval(<<'.,.,', 'parser.racc',
|
739
|
-
def
|
776
|
+
module_eval(<<'.,.,', 'parser.racc', 147)
|
777
|
+
def _reduce_59(val, _values, result)
|
740
778
|
result = RDL::Type::SingletonType.new(val[0].to_i)
|
741
779
|
result
|
742
780
|
end
|
743
781
|
.,.,
|
744
782
|
|
745
|
-
module_eval(<<'.,.,', 'parser.racc',
|
746
|
-
def
|
783
|
+
module_eval(<<'.,.,', 'parser.racc', 148)
|
784
|
+
def _reduce_60(val, _values, result)
|
747
785
|
result = RDL::Type::SingletonType.new(val[0].to_f)
|
748
786
|
result
|
749
787
|
end
|
750
788
|
.,.,
|
751
789
|
|
752
|
-
module_eval(<<'.,.,', 'parser.racc',
|
753
|
-
def
|
790
|
+
module_eval(<<'.,.,', 'parser.racc', 150)
|
791
|
+
def _reduce_61(val, _values, result)
|
754
792
|
result = RDL::Type::SingletonType.new(Kernel.const_get(val[1]))
|
755
793
|
|
756
794
|
result
|
757
795
|
end
|
758
796
|
.,.,
|
759
797
|
|
760
|
-
module_eval(<<'.,.,', 'parser.racc',
|
761
|
-
def
|
798
|
+
module_eval(<<'.,.,', 'parser.racc', 154)
|
799
|
+
def _reduce_62(val, _values, result)
|
762
800
|
result = RDL::Type::WildQuery.new
|
763
801
|
result
|
764
802
|
end
|