rdl 2.0.1 → 2.1.0
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/.travis.yml +13 -0
- data/CHANGES.md +35 -0
- data/README.md +153 -116
- data/bin/rdl_query +1 -1
- data/extras/type_tests/typetests.rb +905 -0
- data/lib/rdl.rb +0 -1
- data/lib/rdl/boot.rb +108 -77
- data/lib/rdl/boot_rails.rb +2 -8
- data/lib/rdl/config.rb +44 -17
- data/lib/rdl/contracts/flat.rb +1 -1
- data/lib/rdl/info.rb +3 -3
- data/lib/rdl/query.rb +11 -11
- data/lib/rdl/typecheck.rb +399 -136
- data/lib/rdl/types/finite_hash.rb +3 -2
- data/lib/rdl/types/generic.rb +7 -6
- data/lib/rdl/types/intersection.rb +3 -2
- data/lib/rdl/types/lexer.rex +2 -3
- data/lib/rdl/types/lexer.rex.rb +1 -4
- data/lib/rdl/types/method.rb +7 -6
- data/lib/rdl/types/nominal.rb +10 -1
- data/lib/rdl/types/parser.racc +7 -8
- data/lib/rdl/types/parser.tab.rb +108 -109
- data/lib/rdl/types/structural.rb +1 -0
- data/lib/rdl/types/tuple.rb +2 -2
- data/lib/rdl/types/type.rb +8 -8
- data/lib/rdl/types/type_inferencer.rb +1 -1
- data/lib/rdl/types/union.rb +2 -1
- data/lib/rdl/util.rb +28 -3
- data/lib/rdl/wrap.rb +216 -165
- data/lib/rdl_disable.rb +22 -15
- data/lib/types/core.rb +2 -4
- data/lib/types/core/_aliases.rb +14 -0
- data/lib/types/core/abbrev.rb +3 -0
- data/lib/types/core/array.rb +139 -0
- data/lib/types/core/base64.rb +8 -0
- data/lib/types/core/basic_object.rb +12 -0
- data/lib/types/core/benchmark.rb +9 -0
- data/lib/types/core/bigdecimal.rb +223 -0
- data/lib/types/core/bigmath.rb +10 -0
- data/lib/types/core/bignum.rb +214 -0
- data/lib/types/core/class.rb +15 -0
- data/lib/types/core/complex.rb +123 -0
- data/lib/types/core/coverage.rb +4 -0
- data/lib/types/core/csv.rb +3 -0
- data/lib/types/core/date.rb +4 -0
- data/lib/types/core/dir.rb +37 -0
- data/lib/types/core/encoding.rb +21 -0
- data/lib/types/core/enumerable.rb +96 -0
- data/lib/types/core/enumerator.rb +24 -0
- data/lib/types/core/exception.rb +15 -0
- data/lib/types/core/file.rb +125 -0
- data/lib/types/core/fileutils.rb +4 -0
- data/lib/types/core/fixnum.rb +213 -0
- data/lib/types/core/float.rb +199 -0
- data/lib/types/core/gem.rb +19 -0
- data/lib/types/core/hash.rb +72 -0
- data/lib/types/core/integer.rb +194 -0
- data/lib/types/core/io.rb +101 -0
- data/lib/types/core/kernel.rb +89 -0
- data/lib/types/core/marshal.rb +3 -0
- data/lib/types/core/matchdata.rb +24 -0
- data/lib/types/core/math.rb +50 -0
- data/lib/types/core/module.rb +81 -0
- data/lib/types/core/nil.rb +11 -0
- data/lib/types/core/numeric.rb +56 -0
- data/lib/types/core/object.rb +73 -0
- data/lib/types/core/pathname.rb +104 -0
- data/lib/types/core/proc.rb +12 -0
- data/lib/types/core/process.rb +110 -0
- data/lib/types/core/random.rb +13 -0
- data/lib/types/core/range.rb +37 -0
- data/lib/types/core/rational.rb +207 -0
- data/lib/types/core/regexp.rb +28 -0
- data/lib/types/core/set.rb +56 -0
- data/lib/types/core/string.rb +140 -0
- data/lib/types/core/strscan.rb +6 -0
- data/lib/types/core/symbol.rb +27 -0
- data/lib/types/core/time.rb +66 -0
- data/lib/types/core/uri.rb +18 -0
- data/lib/types/core/yaml.rb +3 -0
- data/lib/types/devise.rb +1 -0
- data/lib/types/devise/controller_helpers.rb +3 -0
- data/lib/types/devise/parameter_sanitizer.rb +2 -0
- data/lib/types/pundit.rb +2 -0
- data/lib/types/rails/_helpers.rb +50 -0
- data/lib/types/rails/abstract_controller/translation.rb +2 -0
- data/lib/types/rails/action_controller/base.rb +3 -0
- data/lib/types/rails/action_controller/instrumentation.rb +6 -0
- data/lib/types/rails/action_controller/metal.rb +3 -0
- data/lib/types/rails/action_controller/mime_responds.rb +13 -0
- data/lib/types/rails/action_controller/parameters.rb +3 -0
- data/lib/types/{rails-5.x → rails}/action_controller/strong_parameters.rb +4 -8
- data/lib/types/rails/action_dispatch/flashhash.rb +8 -0
- data/lib/types/rails/action_dispatch/routing.rb +10 -0
- data/lib/types/rails/action_mailer/base.rb +2 -0
- data/lib/types/rails/action_mailer/message_delivery.rb +2 -0
- data/lib/types/rails/action_view/helpers_sanitizehelper.rb +2 -0
- data/lib/types/rails/action_view/helpers_urlhelper.rb +5 -0
- data/lib/types/rails/active_model/errors.rb +14 -0
- data/lib/types/rails/active_model/validations.rb +2 -0
- data/lib/types/rails/active_record/associations.rb +208 -0
- data/lib/types/rails/active_record/base.rb +2 -0
- data/lib/types/rails/active_record/core.rb +2 -0
- data/lib/types/rails/active_record/finder_methods.rb +2 -0
- data/lib/types/rails/active_record/model_schema.rb +37 -0
- data/lib/types/rails/active_record/relation.rb +11 -0
- data/lib/types/rails/active_record/schema_types.rb +51 -0
- data/lib/types/rails/active_record/validations.rb +2 -0
- data/lib/types/rails/active_support/base.rb +2 -0
- data/lib/types/rails/active_support/logger.rb +3 -0
- data/lib/types/rails/active_support/tagged_logging.rb +2 -0
- data/lib/types/rails/active_support/time_with_zone.rb +13 -0
- data/lib/types/rails/active_support/time_zone.rb +2 -0
- data/lib/types/rails/fixnum.rb +2 -0
- data/lib/types/rails/integer.rb +2 -0
- data/lib/types/rails/rack/request.rb +2 -0
- data/lib/types/rails/string.rb +3 -0
- data/lib/types/rails/time.rb +1 -0
- data/rdl.gemspec +2 -2
- data/test/disabled_test_rdoc.rb +8 -8
- data/test/test_alias.rb +1 -0
- data/test/test_dsl.rb +4 -4
- data/test/test_generic.rb +45 -38
- data/test/test_intersection.rb +10 -10
- data/test/test_le.rb +103 -102
- data/test/test_member.rb +33 -33
- data/test/test_parser.rb +101 -96
- data/test/test_query.rb +84 -84
- data/test/test_rdl.rb +87 -52
- data/test/test_rdl_type.rb +26 -9
- data/test/test_type_contract.rb +32 -31
- data/test/test_typecheck.rb +802 -436
- data/test/test_types.rb +39 -39
- data/test/test_wrap.rb +3 -2
- metadata +91 -120
- data/extras/type_tests/%.rb +0 -171
- data/extras/type_tests/&.rb +0 -159
- data/extras/type_tests/**.rb +0 -222
- data/extras/type_tests/*.rb +0 -177
- data/extras/type_tests/+.rb +0 -170
- data/extras/type_tests/-.rb +0 -171
- data/extras/type_tests/1scomp.rb +0 -157
- data/extras/type_tests/<.rb +0 -170
- data/extras/type_tests/<<.rb +0 -159
- data/extras/type_tests/>>.rb +0 -159
- data/extras/type_tests/[].rb +0 -163
- data/extras/type_tests/^.rb +0 -159
- data/extras/type_tests/abs.rb +0 -155
- data/extras/type_tests/abs2.rb +0 -164
- data/extras/type_tests/angle.rb +0 -157
- data/extras/type_tests/arg.rb +0 -157
- data/extras/type_tests/bit_length.rb +0 -157
- data/extras/type_tests/ceil.rb +0 -157
- data/extras/type_tests/ceilRational.rb +0 -160
- data/extras/type_tests/conj.rb +0 -158
- data/extras/type_tests/defwhere.rb +0 -86
- data/extras/type_tests/denominator.rb +0 -157
- data/extras/type_tests/div.rb +0 -172
- data/extras/type_tests/divslash.rb +0 -179
- data/extras/type_tests/even?.rb +0 -157
- data/extras/type_tests/fdiv.rb +0 -244
- data/extras/type_tests/finite?.rb +0 -157
- data/extras/type_tests/floor.rb +0 -157
- data/extras/type_tests/floorRational.rb +0 -161
- data/extras/type_tests/hash.rb +0 -157
- data/extras/type_tests/imag.rb +0 -158
- data/extras/type_tests/infinite?.rb +0 -157
- data/extras/type_tests/modulo.rb +0 -171
- data/extras/type_tests/nan?.rb +0 -157
- data/extras/type_tests/neg.rb +0 -155
- data/extras/type_tests/next.rb +0 -157
- data/extras/type_tests/next_float.rb +0 -157
- data/extras/type_tests/numerator.rb +0 -157
- data/extras/type_tests/phase.rb +0 -157
- data/extras/type_tests/prev_float.rb +0 -157
- data/extras/type_tests/quo.rb +0 -179
- data/extras/type_tests/rationalize.rb +0 -157
- data/extras/type_tests/rationalizeArg.rb +0 -198
- data/extras/type_tests/real.rb +0 -157
- data/extras/type_tests/real?.rb +0 -157
- data/extras/type_tests/round.rb +0 -157
- data/extras/type_tests/roundArg.rb +0 -169
- data/extras/type_tests/size.rb +0 -157
- data/extras/type_tests/to_c.rb +0 -157
- data/extras/type_tests/to_f.rb +0 -155
- data/extras/type_tests/to_i.rb +0 -157
- data/extras/type_tests/to_r.rb +0 -157
- data/extras/type_tests/to_s.rb +0 -157
- data/extras/type_tests/truncate.rb +0 -157
- data/extras/type_tests/truncateArg.rb +0 -166
- data/extras/type_tests/type tests +0 -1
- data/extras/type_tests/zero?.rb +0 -155
- data/extras/type_tests/|.rb +0 -159
- data/lib/types/core-ruby-2.x/_aliases.rb +0 -15
- data/lib/types/core-ruby-2.x/abbrev.rb +0 -5
- data/lib/types/core-ruby-2.x/array.rb +0 -137
- data/lib/types/core-ruby-2.x/base64.rb +0 -10
- data/lib/types/core-ruby-2.x/basic_object.rb +0 -14
- data/lib/types/core-ruby-2.x/benchmark.rb +0 -11
- data/lib/types/core-ruby-2.x/bigdecimal.rb +0 -224
- data/lib/types/core-ruby-2.x/bigmath.rb +0 -12
- data/lib/types/core-ruby-2.x/bignum.rb +0 -214
- data/lib/types/core-ruby-2.x/class.rb +0 -17
- data/lib/types/core-ruby-2.x/complex.rb +0 -124
- data/lib/types/core-ruby-2.x/coverage.rb +0 -6
- data/lib/types/core-ruby-2.x/csv.rb +0 -5
- data/lib/types/core-ruby-2.x/date.rb +0 -6
- data/lib/types/core-ruby-2.x/dir.rb +0 -38
- data/lib/types/core-ruby-2.x/encoding.rb +0 -23
- data/lib/types/core-ruby-2.x/enumerable.rb +0 -98
- data/lib/types/core-ruby-2.x/enumerator.rb +0 -26
- data/lib/types/core-ruby-2.x/exception.rb +0 -17
- data/lib/types/core-ruby-2.x/file.rb +0 -126
- data/lib/types/core-ruby-2.x/fileutils.rb +0 -6
- data/lib/types/core-ruby-2.x/fixnum.rb +0 -213
- data/lib/types/core-ruby-2.x/float.rb +0 -199
- data/lib/types/core-ruby-2.x/gem.rb +0 -247
- data/lib/types/core-ruby-2.x/hash.rb +0 -72
- data/lib/types/core-ruby-2.x/integer.rb +0 -197
- data/lib/types/core-ruby-2.x/io.rb +0 -103
- data/lib/types/core-ruby-2.x/kernel.rb +0 -90
- data/lib/types/core-ruby-2.x/marshal.rb +0 -5
- data/lib/types/core-ruby-2.x/matchdata.rb +0 -26
- data/lib/types/core-ruby-2.x/math.rb +0 -53
- data/lib/types/core-ruby-2.x/module.rb +0 -83
- data/lib/types/core-ruby-2.x/nil.rb +0 -12
- data/lib/types/core-ruby-2.x/numeric.rb +0 -56
- data/lib/types/core-ruby-2.x/object.rb +0 -75
- data/lib/types/core-ruby-2.x/pathname.rb +0 -106
- data/lib/types/core-ruby-2.x/proc.rb +0 -16
- data/lib/types/core-ruby-2.x/process.rb +0 -127
- data/lib/types/core-ruby-2.x/random.rb +0 -17
- data/lib/types/core-ruby-2.x/range.rb +0 -39
- data/lib/types/core-ruby-2.x/rational.rb +0 -209
- data/lib/types/core-ruby-2.x/regexp.rb +0 -30
- data/lib/types/core-ruby-2.x/set.rb +0 -58
- data/lib/types/core-ruby-2.x/string.rb +0 -143
- data/lib/types/core-ruby-2.x/strscan.rb +0 -7
- data/lib/types/core-ruby-2.x/symbol.rb +0 -29
- data/lib/types/core-ruby-2.x/time.rb +0 -68
- data/lib/types/core-ruby-2.x/uri.rb +0 -20
- data/lib/types/core-ruby-2.x/yaml.rb +0 -5
- data/lib/types/rails-5.x/_helpers.rb +0 -52
- data/lib/types/rails-5.x/action_controller/mime_responds.rb +0 -11
- data/lib/types/rails-5.x/action_dispatch/routing.rb +0 -10
- data/lib/types/rails-5.x/active_model/errors.rb +0 -15
- data/lib/types/rails-5.x/active_model/validations.rb +0 -5
- data/lib/types/rails-5.x/active_record/associations.rb +0 -190
- data/lib/types/rails-5.x/active_record/core.rb +0 -3
- data/lib/types/rails-5.x/active_record/model_schema.rb +0 -39
- data/lib/types/rails-5.x/fixnum.rb +0 -3
|
@@ -51,6 +51,7 @@ module RDL::Type
|
|
|
51
51
|
other = other.canonical
|
|
52
52
|
other = other.type if other.instance_of? AnnotatedArgType
|
|
53
53
|
return true if other.instance_of? WildQuery
|
|
54
|
+
return false unless other.instance_of? FiniteHashType
|
|
54
55
|
return false unless ((@rest.nil? && other.rest.nil?) ||
|
|
55
56
|
(!@rest.nil? && !other.rest.nil? && @rest.match(other.rest)))
|
|
56
57
|
return (@elts.length == other.elts.length &&
|
|
@@ -63,10 +64,10 @@ module RDL::Type
|
|
|
63
64
|
domain_type = UnionType.new(*(@elts.keys.map { |k| NominalType.new(k.class) }))
|
|
64
65
|
range_type = UnionType.new(*@elts.values)
|
|
65
66
|
if @rest
|
|
66
|
-
domain_type = UnionType.new(domain_type,
|
|
67
|
+
domain_type = UnionType.new(domain_type, RDL::Globals.types[:symbol])
|
|
67
68
|
range_type = UnionType.new(range_type, @rest)
|
|
68
69
|
end
|
|
69
|
-
@the_hash = GenericType.new(
|
|
70
|
+
@the_hash = GenericType.new(RDL::Globals.types[:hash], domain_type, range_type)
|
|
70
71
|
# same logic as Tuple
|
|
71
72
|
return (@lbounds.all? { |lbound| lbound <= self }) && (@ubounds.all? { |ubound| self <= ubound })
|
|
72
73
|
end
|
data/lib/rdl/types/generic.rb
CHANGED
|
@@ -2,14 +2,14 @@ require_relative 'type'
|
|
|
2
2
|
|
|
3
3
|
module RDL::Type
|
|
4
4
|
# A type that is parameterized on one or more other types. The base type
|
|
5
|
-
# must be a NominalType, while the parameters should be strings or symbols
|
|
5
|
+
# must be a NominalType or self, while the parameters should be strings or symbols
|
|
6
6
|
class GenericType < Type
|
|
7
7
|
attr_reader :base
|
|
8
8
|
attr_reader :params
|
|
9
9
|
|
|
10
10
|
def initialize(base, *params)
|
|
11
11
|
raise RuntimeError, "Attempt to create generic type with non-type param" unless params.all? { |p| p.is_a? Type }
|
|
12
|
-
raise "base must be NominalType" unless base.instance_of? NominalType
|
|
12
|
+
raise "base must be NominalType or self, got #{base} of type #{base.class}" unless ((base.instance_of? NominalType) || ((base.instance_of? VarType) && (base.name.to_s == "self")))
|
|
13
13
|
@base = base
|
|
14
14
|
@params = params
|
|
15
15
|
super()
|
|
@@ -31,6 +31,7 @@ module RDL::Type
|
|
|
31
31
|
other = other.canonical
|
|
32
32
|
other = other.type if other.instance_of? AnnotatedArgType
|
|
33
33
|
return true if other.instance_of? WildQuery
|
|
34
|
+
return false unless other.instance_of? GenericType
|
|
34
35
|
return @params.length == other.params.length && @params.zip(other.params).all? { |t,o| t.match(o) }
|
|
35
36
|
end
|
|
36
37
|
|
|
@@ -39,8 +40,8 @@ module RDL::Type
|
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
def member?(obj, *args)
|
|
42
|
-
raise "No type parameters defined for #{base.name}" unless
|
|
43
|
-
# formals =
|
|
43
|
+
raise "No type parameters defined for #{base.name}" unless RDL::Globals.type_params[base.name]
|
|
44
|
+
# formals = RDL::Globals.type_params[base.name][0]
|
|
44
45
|
t = RDL::Util.rdl_type obj
|
|
45
46
|
return t <= self if t
|
|
46
47
|
return false unless base.member?(obj, *args)
|
|
@@ -48,7 +49,7 @@ module RDL::Type
|
|
|
48
49
|
end
|
|
49
50
|
|
|
50
51
|
def instantiate(inst)
|
|
51
|
-
GenericType.new(base, *params.map { |t| t.instantiate(inst) })
|
|
52
|
+
GenericType.new(base.instantiate(inst), *params.map { |t| t.instantiate(inst) })
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
def hash
|
|
@@ -56,7 +57,7 @@ module RDL::Type
|
|
|
56
57
|
end
|
|
57
58
|
|
|
58
59
|
def to_inst
|
|
59
|
-
return
|
|
60
|
+
return RDL::Globals.type_params[base.name][0].zip(@params).to_h
|
|
60
61
|
end
|
|
61
62
|
end
|
|
62
63
|
end
|
|
@@ -13,7 +13,7 @@ module RDL::Type
|
|
|
13
13
|
def self.new(*types)
|
|
14
14
|
ts = []
|
|
15
15
|
types.each { |t|
|
|
16
|
-
if t.
|
|
16
|
+
if t == RDL::Globals.types[:bot]
|
|
17
17
|
next
|
|
18
18
|
elsif t.instance_of? IntersectionType
|
|
19
19
|
ts.concat t.types
|
|
@@ -25,7 +25,7 @@ module RDL::Type
|
|
|
25
25
|
ts.sort! { |a,b| a.object_id <=> b.object_id }
|
|
26
26
|
ts.uniq!
|
|
27
27
|
|
|
28
|
-
return
|
|
28
|
+
return RDL::Globals.types[:bot] if ts.size == 0
|
|
29
29
|
return ts[0] if ts.size == 1
|
|
30
30
|
|
|
31
31
|
t = @@cache[ts]
|
|
@@ -56,6 +56,7 @@ module RDL::Type
|
|
|
56
56
|
other = other.canonical
|
|
57
57
|
other = other.type if other.instance_of? AnnotatedArgType
|
|
58
58
|
return true if other.instance_of? WildQuery
|
|
59
|
+
return false unless other.instance_of? IntersectionType
|
|
59
60
|
return false if @types.length != other.types.length
|
|
60
61
|
@types.all? { |t| other.types.any? { |ot| t.match(ot) } }
|
|
61
62
|
end
|
data/lib/rdl/types/lexer.rex
CHANGED
|
@@ -12,7 +12,6 @@ macro
|
|
|
12
12
|
|
|
13
13
|
rule
|
|
14
14
|
\s # skip
|
|
15
|
-
or { [:OR, text] }
|
|
16
15
|
-> { [:RARROW, text] }
|
|
17
16
|
=> { [:RASSOC, text] }
|
|
18
17
|
\( { [:LPAREN, text] }
|
|
@@ -27,7 +26,7 @@ rule
|
|
|
27
26
|
, { [:COMMA, text] }
|
|
28
27
|
\? { [:QUERY, text] }
|
|
29
28
|
\! { [:BANG, text] }
|
|
30
|
-
\*\* { [:STARSTAR, text] }
|
|
29
|
+
\*\* { [:STARSTAR, text] }
|
|
31
30
|
\* { [:STAR, text] }
|
|
32
31
|
\#T { [:HASH_TYPE, text] }
|
|
33
32
|
\#Q { [:HASH_QUERY, text] }
|
|
@@ -36,7 +35,7 @@ rule
|
|
|
36
35
|
\. { [:DOT, text] }
|
|
37
36
|
{FLOAT} { [:FLOAT, text] } # Must go before FIXNUM
|
|
38
37
|
{FIXNUM} { [:FIXNUM, text] }
|
|
39
|
-
{ID} { [:ID, text] }
|
|
38
|
+
{ID} { if text == "or" then [:OR, text] else [:ID, text] end }
|
|
40
39
|
{SYMBOL} { [:SYMBOL, text[1..-1]] }
|
|
41
40
|
\: { [:COLON, text] } # Must come after SYMBOL
|
|
42
41
|
{SPECIAL_ID} { [:SPECIAL_ID, text] }
|
data/lib/rdl/types/lexer.rex.rb
CHANGED
|
@@ -61,9 +61,6 @@ class Parser < Racc::Parser
|
|
|
61
61
|
when (text = @ss.scan(/\s/))
|
|
62
62
|
;
|
|
63
63
|
|
|
64
|
-
when (text = @ss.scan(/or/))
|
|
65
|
-
action { [:OR, text] }
|
|
66
|
-
|
|
67
64
|
when (text = @ss.scan(/->/))
|
|
68
65
|
action { [:RARROW, text] }
|
|
69
66
|
|
|
@@ -134,7 +131,7 @@ class Parser < Racc::Parser
|
|
|
134
131
|
action { [:FIXNUM, text] }
|
|
135
132
|
|
|
136
133
|
when (text = @ss.scan(/(\w|\:\:)+/))
|
|
137
|
-
action { [:ID, text] }
|
|
134
|
+
action { if text == "or" then [:OR, text] else [:ID, text] end }
|
|
138
135
|
|
|
139
136
|
when (text = @ss.scan(/:\w+/))
|
|
140
137
|
action { [:SYMBOL, text[1..-1]] }
|
data/lib/rdl/types/method.rb
CHANGED
|
@@ -62,7 +62,7 @@ module RDL::Type
|
|
|
62
62
|
until states.empty?
|
|
63
63
|
formal, actual = states.pop
|
|
64
64
|
if formal == @args.size && actual == args.size then # Matched all actuals, no formals left over
|
|
65
|
-
|
|
65
|
+
check_arg_preds(bind, preds) if preds.size > 0
|
|
66
66
|
@args.each_with_index {|a,i| args[i] = block_wrap(slf, inst, a, bind, &args[i]) if a.is_a? MethodType }
|
|
67
67
|
if @block then
|
|
68
68
|
if @block.is_a? OptionalType
|
|
@@ -115,7 +115,7 @@ module RDL::Type
|
|
|
115
115
|
states << [formal+1, actual] # doesn't match, must skip
|
|
116
116
|
end
|
|
117
117
|
when DependentArgType
|
|
118
|
-
|
|
118
|
+
bind.local_variable_set(t.name.to_sym,args[actual])
|
|
119
119
|
preds.push(t)
|
|
120
120
|
t = t.type.instantiate(inst)
|
|
121
121
|
the_actual = nil
|
|
@@ -234,7 +234,7 @@ RUBY
|
|
|
234
234
|
# otherwise raises exception. Returns array of method types that
|
|
235
235
|
# matched [+args+] and [+blk+]
|
|
236
236
|
def self.check_arg_types(method_name, slf, bind, types, inst, *args, &blk)
|
|
237
|
-
|
|
237
|
+
RDL::Globals.contract_switch.off {
|
|
238
238
|
matches = [] # types that matched args
|
|
239
239
|
types.each_with_index { |t, i|
|
|
240
240
|
res, args, blk, bind = t.pre_cond?(blk, slf, inst, bind, *args)
|
|
@@ -255,7 +255,7 @@ RUBY
|
|
|
255
255
|
end
|
|
256
256
|
|
|
257
257
|
def self.check_ret_types(slf, method_name, types, inst, matches, ret, bind, *args, &blk)
|
|
258
|
-
|
|
258
|
+
RDL::Globals.contract_switch.off {
|
|
259
259
|
matches.each { |i| res,new_ret = types[i].post_cond?(slf, inst, ret, bind, *args)
|
|
260
260
|
return new_ret if res
|
|
261
261
|
}
|
|
@@ -308,6 +308,7 @@ RUBY
|
|
|
308
308
|
def match(other)
|
|
309
309
|
other = other.type if other.instance_of? AnnotatedArgType
|
|
310
310
|
return true if other.instance_of? WildQuery
|
|
311
|
+
return false unless other.instance_of? MethodType
|
|
311
312
|
return false unless @ret.match(other.ret)
|
|
312
313
|
if @block == nil
|
|
313
314
|
return false unless other.block == nil
|
|
@@ -349,7 +350,7 @@ RUBY
|
|
|
349
350
|
end
|
|
350
351
|
|
|
351
352
|
def self.check_block_arg_types(slf, types, inst, bind, *args)
|
|
352
|
-
|
|
353
|
+
RDL::Globals.contract_switch.off {
|
|
353
354
|
res,args,blk,bind = types.pre_cond?(nil, slf, inst, bind, *args)
|
|
354
355
|
return [true, args, blk, bind] if res
|
|
355
356
|
raise TypeError, <<RUBY
|
|
@@ -365,7 +366,7 @@ RUBY
|
|
|
365
366
|
end
|
|
366
367
|
|
|
367
368
|
def self.check_block_ret_types(slf, types, inst, ret, bind, *args)
|
|
368
|
-
|
|
369
|
+
RDL::Globals.contract_switch.off {
|
|
369
370
|
res,new_ret = types.post_cond?(slf, inst, ret, bind, *args)
|
|
370
371
|
return new_ret if res
|
|
371
372
|
raise TypeError, <<RUBY
|
data/lib/rdl/types/nominal.rb
CHANGED
|
@@ -40,7 +40,16 @@ module RDL::Type
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def to_s
|
|
43
|
-
|
|
43
|
+
if @name.start_with? '#<Class:'
|
|
44
|
+
if @name['('] # Rails models such as Talk(:id, :name, ...)
|
|
45
|
+
n = @name.split('(')[0] + '>'
|
|
46
|
+
else
|
|
47
|
+
n = @name
|
|
48
|
+
end
|
|
49
|
+
return RDL::Util.add_singleton_marker(n[8..-2])
|
|
50
|
+
else
|
|
51
|
+
return @name
|
|
52
|
+
end
|
|
44
53
|
end
|
|
45
54
|
|
|
46
55
|
def klass
|
data/lib/rdl/types/parser.racc
CHANGED
|
@@ -110,11 +110,11 @@ rule
|
|
|
110
110
|
SYMBOL { result = RDL::Type::SingletonType.new(val[0].to_sym) }
|
|
111
111
|
| ID {
|
|
112
112
|
if val[0] == 'nil' then
|
|
113
|
-
result =
|
|
113
|
+
result = RDL::Globals.types[:nil]
|
|
114
114
|
elsif val[0] == 'true' then
|
|
115
|
-
result =
|
|
115
|
+
result = RDL::Globals.types[:true]
|
|
116
116
|
elsif val[0] == 'false'
|
|
117
|
-
result =
|
|
117
|
+
result = RDL::Globals.types[:false]
|
|
118
118
|
elsif val[0] =~ /^[a-z_]+\w*\'?/ then
|
|
119
119
|
result = RDL::Type::VarType.new(val[0].to_sym)
|
|
120
120
|
else
|
|
@@ -122,15 +122,14 @@ rule
|
|
|
122
122
|
end
|
|
123
123
|
}
|
|
124
124
|
| SPECIAL_ID {
|
|
125
|
-
if
|
|
126
|
-
result =
|
|
125
|
+
if RDL::Globals.special_types.has_key? val[0] then
|
|
126
|
+
result = RDL::Globals.special_types[val[0]]
|
|
127
127
|
else
|
|
128
128
|
fail "Unexpected special type identifier #{val[0]}"
|
|
129
129
|
end
|
|
130
130
|
}
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
result = RDL::Type::GenericType.new(n, *val[2])
|
|
131
|
+
| single_type LESS type_expr_comma_list GREATER {
|
|
132
|
+
result = RDL::Type::GenericType.new(val[0], *val[2])
|
|
134
133
|
}
|
|
135
134
|
| LBRACE method_type RBRACE { result = val[1] }
|
|
136
135
|
| LBRACKET type_expr_comma_list RBRACKET {
|
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', 161)
|
|
15
15
|
|
|
16
16
|
def initialize()
|
|
17
17
|
@yydebug = true
|
|
@@ -21,140 +21,140 @@ end
|
|
|
21
21
|
##### State transition tables begin ###
|
|
22
22
|
|
|
23
23
|
racc_action_table = [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
18, 19, 20, 13, 22, nil, 15, 14,
|
|
24
|
+
38, 68, 21, 101, 19, 20, 41, 22, 29, 32,
|
|
25
|
+
14, 16, 7, 83, 11, 103, 17, 84, 18, 31,
|
|
26
|
+
33, 13, 31, 34, 105, 39, 39, 21, 106, 19,
|
|
27
|
+
20, 108, 22, 29, 32, 14, 16, 7, 111, 11,
|
|
28
|
+
113, 17, 114, 18, 77, 33, 13, 31, 34, 45,
|
|
29
|
+
115, 43, 44, 5, 6, 45, 41, 43, 44, 46,
|
|
30
|
+
8, 7, 41, 7, 36, 46, 56, 7, 57, 48,
|
|
31
|
+
58, 21, 59, 19, 20, 48, 22, 60, 15, 14,
|
|
32
|
+
16, 62, 65, 11, 62, 17, 21, 18, 19, 20,
|
|
33
|
+
13, 22, 69, 15, 14, 16, 70, 71, 72, 73,
|
|
34
|
+
17, 21, 18, 19, 20, 13, 22, 75, 15, 14,
|
|
35
|
+
16, 76, 77, 11, 78, 17, 21, 18, 19, 20,
|
|
36
|
+
13, 22, 79, 15, 14, 16, 80, 81, 11, 87,
|
|
37
|
+
17, 21, 18, 19, 20, 13, 22, 92, 15, 14,
|
|
38
|
+
16, 96, 7, 11, nil, 17, 21, 18, 19, 20,
|
|
39
|
+
13, 22, nil, 15, 14, 16, nil, nil, 11, nil,
|
|
40
|
+
17, 21, 18, 19, 20, 13, 22, nil, 15, 14,
|
|
41
|
+
16, nil, nil, 11, nil, 17, nil, 18, nil, 90,
|
|
42
|
+
13, 21, nil, 19, 20, nil, 22, nil, 15, 14,
|
|
43
|
+
16, nil, nil, 11, nil, 17, 21, 18, 19, 20,
|
|
44
|
+
13, 22, nil, 15, 14, 16, nil, nil, nil, nil,
|
|
45
|
+
17, 21, 18, 19, 20, 13, 22, nil, 15, 14,
|
|
46
|
+
16, nil, nil, nil, nil, 17, 21, 18, 19, 20,
|
|
47
|
+
13, 22, nil, 15, 14, 16, nil, nil, nil, nil,
|
|
48
|
+
17, 21, 18, 19, 20, 13, 22, nil, 51, 14,
|
|
49
|
+
16, nil, nil, 11, nil, 17, nil, 18, 55, 21,
|
|
50
|
+
13, 19, 20, nil, 22, nil, 15, 14, 16, nil,
|
|
41
51
|
nil, nil, nil, 17, 21, 18, 19, 20, 13, 22,
|
|
42
52
|
nil, 15, 14, 16, nil, nil, nil, nil, 17, 21,
|
|
43
53
|
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
54
|
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
55
|
nil, 15, 14, 16, nil, nil, 11, nil, 17, 21,
|
|
51
56
|
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
|
52
57
|
nil, 11, nil, 17, 21, 18, 19, 20, 13, 22,
|
|
53
58
|
nil, 15, 14, 16, nil, nil, 11, nil, 17, 21,
|
|
54
59
|
18, 19, 20, 13, 22, nil, 15, 14, 16, nil,
|
|
55
|
-
nil,
|
|
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 ]
|
|
60
|
+
nil, nil, nil, 17, nil, 18 ]
|
|
61
61
|
|
|
62
62
|
racc_action_check = [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
11,
|
|
73
|
-
|
|
74
|
-
78,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
nil,
|
|
86
|
-
nil,
|
|
87
|
-
|
|
88
|
-
nil, nil, nil,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
nil,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
nil,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
nil,
|
|
98
|
-
|
|
99
|
-
13 ]
|
|
63
|
+
12, 40, 58, 82, 58, 58, 60, 58, 58, 58,
|
|
64
|
+
58, 58, 83, 57, 58, 84, 58, 57, 58, 60,
|
|
65
|
+
58, 58, 58, 58, 96, 12, 40, 7, 99, 7,
|
|
66
|
+
7, 102, 7, 7, 7, 7, 7, 103, 106, 7,
|
|
67
|
+
107, 7, 109, 7, 111, 7, 7, 7, 7, 17,
|
|
68
|
+
113, 17, 17, 0, 0, 73, 17, 73, 73, 17,
|
|
69
|
+
1, 17, 73, 6, 8, 73, 21, 0, 24, 17,
|
|
70
|
+
27, 11, 28, 11, 11, 73, 11, 30, 11, 11,
|
|
71
|
+
11, 32, 37, 11, 41, 11, 72, 11, 72, 72,
|
|
72
|
+
11, 72, 43, 72, 72, 72, 44, 45, 46, 47,
|
|
73
|
+
72, 78, 72, 78, 78, 72, 78, 49, 78, 78,
|
|
74
|
+
78, 50, 51, 78, 52, 78, 48, 78, 48, 48,
|
|
75
|
+
78, 48, 53, 48, 48, 48, 54, 56, 48, 59,
|
|
76
|
+
48, 90, 48, 90, 90, 48, 90, 67, 90, 90,
|
|
77
|
+
90, 71, 77, 90, nil, 90, 31, 90, 31, 31,
|
|
78
|
+
90, 31, nil, 31, 31, 31, nil, nil, 31, nil,
|
|
79
|
+
31, 62, 31, 62, 62, 31, 62, nil, 62, 62,
|
|
80
|
+
62, nil, nil, 62, nil, 62, nil, 62, nil, 62,
|
|
81
|
+
62, 5, nil, 5, 5, nil, 5, nil, 5, 5,
|
|
82
|
+
5, nil, nil, 5, nil, 5, 68, 5, 68, 68,
|
|
83
|
+
5, 68, nil, 68, 68, 68, nil, nil, nil, nil,
|
|
84
|
+
68, 69, 68, 69, 69, 68, 69, nil, 69, 69,
|
|
85
|
+
69, nil, nil, nil, nil, 69, 70, 69, 70, 70,
|
|
86
|
+
69, 70, nil, 70, 70, 70, nil, nil, nil, nil,
|
|
87
|
+
70, 18, 70, 18, 18, 70, 18, nil, 18, 18,
|
|
88
|
+
18, nil, nil, 18, nil, 18, nil, 18, 18, 105,
|
|
89
|
+
18, 105, 105, nil, 105, nil, 105, 105, 105, nil,
|
|
90
|
+
nil, nil, nil, 105, 38, 105, 38, 38, 105, 38,
|
|
91
|
+
nil, 38, 38, 38, nil, nil, nil, nil, 38, 39,
|
|
92
|
+
38, 39, 39, 38, 39, nil, 39, 39, 39, nil,
|
|
93
|
+
nil, 39, nil, 39, 33, 39, 33, 33, 39, 33,
|
|
94
|
+
nil, 33, 33, 33, nil, nil, 33, nil, 33, 101,
|
|
95
|
+
33, 101, 101, 33, 101, nil, 101, 101, 101, nil,
|
|
96
|
+
nil, 101, nil, 101, 34, 101, 34, 34, 101, 34,
|
|
97
|
+
nil, 34, 34, 34, nil, nil, 34, nil, 34, 13,
|
|
98
|
+
34, 13, 13, 34, 13, nil, 13, 13, 13, nil,
|
|
99
|
+
nil, nil, nil, 13, nil, 13 ]
|
|
100
100
|
|
|
101
101
|
racc_action_pointer = [
|
|
102
|
-
|
|
103
|
-
nil,
|
|
104
|
-
nil,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
|
|
110
|
-
nil, nil,
|
|
111
|
-
|
|
112
|
-
nil,
|
|
113
|
-
nil,
|
|
102
|
+
48, 60, nil, nil, nil, 174, 44, 20, 64, nil,
|
|
103
|
+
nil, 64, -4, 342, nil, nil, nil, 42, 234, nil,
|
|
104
|
+
nil, 52, nil, nil, 48, nil, nil, 68, 58, nil,
|
|
105
|
+
75, 139, 70, 297, 327, nil, nil, 62, 267, 282,
|
|
106
|
+
-3, 73, nil, 84, 88, 83, 90, 97, 109, 85,
|
|
107
|
+
89, 101, 112, 98, 102, nil, 105, -8, -5, 111,
|
|
108
|
+
-8, nil, 154, nil, nil, nil, nil, 107, 189, 204,
|
|
109
|
+
219, 119, 79, 48, nil, nil, nil, 123, 94, nil,
|
|
110
|
+
nil, nil, 0, -7, -6, nil, nil, nil, nil, nil,
|
|
111
|
+
124, nil, nil, nil, nil, nil, 16, nil, nil, 26,
|
|
112
|
+
nil, 312, 9, 18, nil, 252, 24, 26, nil, 20,
|
|
113
|
+
nil, 33, nil, 32, nil, nil ]
|
|
114
114
|
|
|
115
115
|
racc_action_default = [
|
|
116
116
|
-63, -63, -1, -2, -3, -63, -63, -11, -63, -4,
|
|
117
117
|
-33, -63, -46, -63, -50, -51, -52, -37, -63, -59,
|
|
118
118
|
-60, -63, -62, -5, -63, -12, -13, -14, -17, -20,
|
|
119
|
-
-21, -63, -51, -63, -63, -27, 116, -63, -63, -
|
|
120
|
-
-
|
|
119
|
+
-21, -63, -51, -63, -63, -27, 116, -63, -63, -63,
|
|
120
|
+
-48, -63, -38, -63, -63, -63, -63, -43, -63, -63,
|
|
121
121
|
-63, -51, -35, -63, -63, -57, -63, -30, -63, -19,
|
|
122
122
|
-63, -22, -63, -25, -26, -34, -47, -63, -63, -63,
|
|
123
123
|
-63, -63, -63, -37, -44, -54, -58, -63, -63, -55,
|
|
124
124
|
-56, -61, -63, -63, -63, -15, -16, -18, -23, -24,
|
|
125
|
-
-63, -29, -
|
|
125
|
+
-63, -29, -53, -49, -39, -40, -63, -42, -45, -9,
|
|
126
126
|
-36, -63, -63, -63, -28, -63, -63, -6, -31, -63,
|
|
127
127
|
-41, -63, -10, -7, -32, -8 ]
|
|
128
128
|
|
|
129
129
|
racc_goto_table = [
|
|
130
|
-
2, 9, 54, 35, 66,
|
|
131
|
-
|
|
132
|
-
nil, nil, nil, nil, nil, nil,
|
|
133
|
-
64,
|
|
130
|
+
2, 9, 54, 35, 66, 53, 23, 37, 50, 26,
|
|
131
|
+
42, 40, 25, 3, 4, 24, 82, 49, 89, 1,
|
|
132
|
+
nil, nil, nil, nil, nil, nil, 67, 61, nil, 63,
|
|
133
|
+
64, nil, nil, nil, 93, 94, 95, nil, 97, nil,
|
|
134
134
|
nil, nil, nil, nil, 74, nil, nil, nil, nil, nil,
|
|
135
135
|
nil, nil, nil, nil, 35, nil, nil, nil, 91, nil,
|
|
136
|
-
nil,
|
|
136
|
+
86, nil, 88, 85, 98, 100, 42, nil, nil, nil,
|
|
137
137
|
nil, 110, nil, nil, nil, nil, nil, 99, nil, nil,
|
|
138
138
|
nil, nil, nil, 102, nil, nil, 104, nil, nil, nil,
|
|
139
139
|
112, nil, nil, nil, nil, nil, nil, 107, nil, nil,
|
|
140
140
|
nil, nil, nil, 109 ]
|
|
141
141
|
|
|
142
142
|
racc_goto_check = [
|
|
143
|
-
2, 5, 8, 5, 15,
|
|
144
|
-
19, 9,
|
|
145
|
-
nil, nil, nil, nil, nil, nil,
|
|
146
|
-
5,
|
|
143
|
+
2, 5, 8, 5, 15, 16, 2, 5, 18, 10,
|
|
144
|
+
13, 19, 9, 3, 4, 6, 7, 2, 14, 1,
|
|
145
|
+
nil, nil, nil, nil, nil, nil, 16, 5, nil, 5,
|
|
146
|
+
5, nil, nil, nil, 15, 15, 15, nil, 15, nil,
|
|
147
147
|
nil, nil, nil, nil, 5, nil, nil, nil, nil, nil,
|
|
148
148
|
nil, nil, nil, nil, 5, nil, nil, nil, 5, nil,
|
|
149
|
-
nil,
|
|
149
|
+
10, nil, 10, 9, 18, 16, 13, nil, nil, nil,
|
|
150
150
|
nil, 15, nil, nil, nil, nil, nil, 2, nil, nil,
|
|
151
151
|
nil, nil, nil, 2, nil, nil, 5, nil, nil, nil,
|
|
152
152
|
8, nil, nil, nil, nil, nil, nil, 5, nil, nil,
|
|
153
153
|
nil, nil, nil, 2 ]
|
|
154
154
|
|
|
155
155
|
racc_goto_pointer = [
|
|
156
|
-
nil, 19, 0, 13, 14, -4, 8, -41, -16,
|
|
157
|
-
|
|
156
|
+
nil, 19, 0, 13, 14, -4, 8, -41, -16, 5,
|
|
157
|
+
2, nil, nil, -7, -44, -34, -13, nil, -9, -2 ]
|
|
158
158
|
|
|
159
159
|
racc_goto_default = [
|
|
160
160
|
nil, nil, nil, nil, nil, 52, nil, nil, nil, nil,
|
|
@@ -698,11 +698,11 @@ module_eval(<<'.,.,', 'parser.racc', 109)
|
|
|
698
698
|
module_eval(<<'.,.,', 'parser.racc', 111)
|
|
699
699
|
def _reduce_51(val, _values, result)
|
|
700
700
|
if val[0] == 'nil' then
|
|
701
|
-
result =
|
|
701
|
+
result = RDL::Globals.types[:nil]
|
|
702
702
|
elsif val[0] == 'true' then
|
|
703
|
-
result =
|
|
703
|
+
result = RDL::Globals.types[:true]
|
|
704
704
|
elsif val[0] == 'false'
|
|
705
|
-
result =
|
|
705
|
+
result = RDL::Globals.types[:false]
|
|
706
706
|
elsif val[0] =~ /^[a-z_]+\w*\'?/ then
|
|
707
707
|
result = RDL::Type::VarType.new(val[0].to_sym)
|
|
708
708
|
else
|
|
@@ -715,8 +715,8 @@ module_eval(<<'.,.,', 'parser.racc', 111)
|
|
|
715
715
|
|
|
716
716
|
module_eval(<<'.,.,', 'parser.racc', 124)
|
|
717
717
|
def _reduce_52(val, _values, result)
|
|
718
|
-
if
|
|
719
|
-
result =
|
|
718
|
+
if RDL::Globals.special_types.has_key? val[0] then
|
|
719
|
+
result = RDL::Globals.special_types[val[0]]
|
|
720
720
|
else
|
|
721
721
|
fail "Unexpected special type identifier #{val[0]}"
|
|
722
722
|
end
|
|
@@ -727,21 +727,20 @@ module_eval(<<'.,.,', 'parser.racc', 124)
|
|
|
727
727
|
|
|
728
728
|
module_eval(<<'.,.,', 'parser.racc', 131)
|
|
729
729
|
def _reduce_53(val, _values, result)
|
|
730
|
-
|
|
731
|
-
result = RDL::Type::GenericType.new(n, *val[2])
|
|
730
|
+
result = RDL::Type::GenericType.new(val[0], *val[2])
|
|
732
731
|
|
|
733
732
|
result
|
|
734
733
|
end
|
|
735
734
|
.,.,
|
|
736
735
|
|
|
737
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
736
|
+
module_eval(<<'.,.,', 'parser.racc', 133)
|
|
738
737
|
def _reduce_54(val, _values, result)
|
|
739
738
|
result = val[1]
|
|
740
739
|
result
|
|
741
740
|
end
|
|
742
741
|
.,.,
|
|
743
742
|
|
|
744
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
743
|
+
module_eval(<<'.,.,', 'parser.racc', 135)
|
|
745
744
|
def _reduce_55(val, _values, result)
|
|
746
745
|
result = RDL::Type::TupleType.new(*val[1])
|
|
747
746
|
|
|
@@ -749,7 +748,7 @@ module_eval(<<'.,.,', 'parser.racc', 136)
|
|
|
749
748
|
end
|
|
750
749
|
.,.,
|
|
751
750
|
|
|
752
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
751
|
+
module_eval(<<'.,.,', 'parser.racc', 138)
|
|
753
752
|
def _reduce_56(val, _values, result)
|
|
754
753
|
result = RDL::Type::StructuralType.new(Hash[*val[1]])
|
|
755
754
|
|
|
@@ -757,7 +756,7 @@ module_eval(<<'.,.,', 'parser.racc', 139)
|
|
|
757
756
|
end
|
|
758
757
|
.,.,
|
|
759
758
|
|
|
760
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
759
|
+
module_eval(<<'.,.,', 'parser.racc', 141)
|
|
761
760
|
def _reduce_57(val, _values, result)
|
|
762
761
|
result = RDL::Type::TupleType.new
|
|
763
762
|
|
|
@@ -765,7 +764,7 @@ module_eval(<<'.,.,', 'parser.racc', 142)
|
|
|
765
764
|
end
|
|
766
765
|
.,.,
|
|
767
766
|
|
|
768
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
767
|
+
module_eval(<<'.,.,', 'parser.racc', 144)
|
|
769
768
|
def _reduce_58(val, _values, result)
|
|
770
769
|
result = RDL::Type::FiniteHashType.new(Hash[*val[1][0]], val[1][1])
|
|
771
770
|
|
|
@@ -773,21 +772,21 @@ module_eval(<<'.,.,', 'parser.racc', 145)
|
|
|
773
772
|
end
|
|
774
773
|
.,.,
|
|
775
774
|
|
|
776
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
775
|
+
module_eval(<<'.,.,', 'parser.racc', 146)
|
|
777
776
|
def _reduce_59(val, _values, result)
|
|
778
777
|
result = RDL::Type::SingletonType.new(val[0].to_i)
|
|
779
778
|
result
|
|
780
779
|
end
|
|
781
780
|
.,.,
|
|
782
781
|
|
|
783
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
782
|
+
module_eval(<<'.,.,', 'parser.racc', 147)
|
|
784
783
|
def _reduce_60(val, _values, result)
|
|
785
784
|
result = RDL::Type::SingletonType.new(val[0].to_f)
|
|
786
785
|
result
|
|
787
786
|
end
|
|
788
787
|
.,.,
|
|
789
788
|
|
|
790
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
789
|
+
module_eval(<<'.,.,', 'parser.racc', 149)
|
|
791
790
|
def _reduce_61(val, _values, result)
|
|
792
791
|
result = RDL::Type::SingletonType.new(Kernel.const_get(val[1]))
|
|
793
792
|
|
|
@@ -795,7 +794,7 @@ module_eval(<<'.,.,', 'parser.racc', 150)
|
|
|
795
794
|
end
|
|
796
795
|
.,.,
|
|
797
796
|
|
|
798
|
-
module_eval(<<'.,.,', 'parser.racc',
|
|
797
|
+
module_eval(<<'.,.,', 'parser.racc', 153)
|
|
799
798
|
def _reduce_62(val, _values, result)
|
|
800
799
|
result = RDL::Type::WildQuery.new
|
|
801
800
|
result
|