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.
Files changed (252) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -0
  3. data/CHANGES.md +35 -0
  4. data/README.md +153 -116
  5. data/bin/rdl_query +1 -1
  6. data/extras/type_tests/typetests.rb +905 -0
  7. data/lib/rdl.rb +0 -1
  8. data/lib/rdl/boot.rb +108 -77
  9. data/lib/rdl/boot_rails.rb +2 -8
  10. data/lib/rdl/config.rb +44 -17
  11. data/lib/rdl/contracts/flat.rb +1 -1
  12. data/lib/rdl/info.rb +3 -3
  13. data/lib/rdl/query.rb +11 -11
  14. data/lib/rdl/typecheck.rb +399 -136
  15. data/lib/rdl/types/finite_hash.rb +3 -2
  16. data/lib/rdl/types/generic.rb +7 -6
  17. data/lib/rdl/types/intersection.rb +3 -2
  18. data/lib/rdl/types/lexer.rex +2 -3
  19. data/lib/rdl/types/lexer.rex.rb +1 -4
  20. data/lib/rdl/types/method.rb +7 -6
  21. data/lib/rdl/types/nominal.rb +10 -1
  22. data/lib/rdl/types/parser.racc +7 -8
  23. data/lib/rdl/types/parser.tab.rb +108 -109
  24. data/lib/rdl/types/structural.rb +1 -0
  25. data/lib/rdl/types/tuple.rb +2 -2
  26. data/lib/rdl/types/type.rb +8 -8
  27. data/lib/rdl/types/type_inferencer.rb +1 -1
  28. data/lib/rdl/types/union.rb +2 -1
  29. data/lib/rdl/util.rb +28 -3
  30. data/lib/rdl/wrap.rb +216 -165
  31. data/lib/rdl_disable.rb +22 -15
  32. data/lib/types/core.rb +2 -4
  33. data/lib/types/core/_aliases.rb +14 -0
  34. data/lib/types/core/abbrev.rb +3 -0
  35. data/lib/types/core/array.rb +139 -0
  36. data/lib/types/core/base64.rb +8 -0
  37. data/lib/types/core/basic_object.rb +12 -0
  38. data/lib/types/core/benchmark.rb +9 -0
  39. data/lib/types/core/bigdecimal.rb +223 -0
  40. data/lib/types/core/bigmath.rb +10 -0
  41. data/lib/types/core/bignum.rb +214 -0
  42. data/lib/types/core/class.rb +15 -0
  43. data/lib/types/core/complex.rb +123 -0
  44. data/lib/types/core/coverage.rb +4 -0
  45. data/lib/types/core/csv.rb +3 -0
  46. data/lib/types/core/date.rb +4 -0
  47. data/lib/types/core/dir.rb +37 -0
  48. data/lib/types/core/encoding.rb +21 -0
  49. data/lib/types/core/enumerable.rb +96 -0
  50. data/lib/types/core/enumerator.rb +24 -0
  51. data/lib/types/core/exception.rb +15 -0
  52. data/lib/types/core/file.rb +125 -0
  53. data/lib/types/core/fileutils.rb +4 -0
  54. data/lib/types/core/fixnum.rb +213 -0
  55. data/lib/types/core/float.rb +199 -0
  56. data/lib/types/core/gem.rb +19 -0
  57. data/lib/types/core/hash.rb +72 -0
  58. data/lib/types/core/integer.rb +194 -0
  59. data/lib/types/core/io.rb +101 -0
  60. data/lib/types/core/kernel.rb +89 -0
  61. data/lib/types/core/marshal.rb +3 -0
  62. data/lib/types/core/matchdata.rb +24 -0
  63. data/lib/types/core/math.rb +50 -0
  64. data/lib/types/core/module.rb +81 -0
  65. data/lib/types/core/nil.rb +11 -0
  66. data/lib/types/core/numeric.rb +56 -0
  67. data/lib/types/core/object.rb +73 -0
  68. data/lib/types/core/pathname.rb +104 -0
  69. data/lib/types/core/proc.rb +12 -0
  70. data/lib/types/core/process.rb +110 -0
  71. data/lib/types/core/random.rb +13 -0
  72. data/lib/types/core/range.rb +37 -0
  73. data/lib/types/core/rational.rb +207 -0
  74. data/lib/types/core/regexp.rb +28 -0
  75. data/lib/types/core/set.rb +56 -0
  76. data/lib/types/core/string.rb +140 -0
  77. data/lib/types/core/strscan.rb +6 -0
  78. data/lib/types/core/symbol.rb +27 -0
  79. data/lib/types/core/time.rb +66 -0
  80. data/lib/types/core/uri.rb +18 -0
  81. data/lib/types/core/yaml.rb +3 -0
  82. data/lib/types/devise.rb +1 -0
  83. data/lib/types/devise/controller_helpers.rb +3 -0
  84. data/lib/types/devise/parameter_sanitizer.rb +2 -0
  85. data/lib/types/pundit.rb +2 -0
  86. data/lib/types/rails/_helpers.rb +50 -0
  87. data/lib/types/rails/abstract_controller/translation.rb +2 -0
  88. data/lib/types/rails/action_controller/base.rb +3 -0
  89. data/lib/types/rails/action_controller/instrumentation.rb +6 -0
  90. data/lib/types/rails/action_controller/metal.rb +3 -0
  91. data/lib/types/rails/action_controller/mime_responds.rb +13 -0
  92. data/lib/types/rails/action_controller/parameters.rb +3 -0
  93. data/lib/types/{rails-5.x → rails}/action_controller/strong_parameters.rb +4 -8
  94. data/lib/types/rails/action_dispatch/flashhash.rb +8 -0
  95. data/lib/types/rails/action_dispatch/routing.rb +10 -0
  96. data/lib/types/rails/action_mailer/base.rb +2 -0
  97. data/lib/types/rails/action_mailer/message_delivery.rb +2 -0
  98. data/lib/types/rails/action_view/helpers_sanitizehelper.rb +2 -0
  99. data/lib/types/rails/action_view/helpers_urlhelper.rb +5 -0
  100. data/lib/types/rails/active_model/errors.rb +14 -0
  101. data/lib/types/rails/active_model/validations.rb +2 -0
  102. data/lib/types/rails/active_record/associations.rb +208 -0
  103. data/lib/types/rails/active_record/base.rb +2 -0
  104. data/lib/types/rails/active_record/core.rb +2 -0
  105. data/lib/types/rails/active_record/finder_methods.rb +2 -0
  106. data/lib/types/rails/active_record/model_schema.rb +37 -0
  107. data/lib/types/rails/active_record/relation.rb +11 -0
  108. data/lib/types/rails/active_record/schema_types.rb +51 -0
  109. data/lib/types/rails/active_record/validations.rb +2 -0
  110. data/lib/types/rails/active_support/base.rb +2 -0
  111. data/lib/types/rails/active_support/logger.rb +3 -0
  112. data/lib/types/rails/active_support/tagged_logging.rb +2 -0
  113. data/lib/types/rails/active_support/time_with_zone.rb +13 -0
  114. data/lib/types/rails/active_support/time_zone.rb +2 -0
  115. data/lib/types/rails/fixnum.rb +2 -0
  116. data/lib/types/rails/integer.rb +2 -0
  117. data/lib/types/rails/rack/request.rb +2 -0
  118. data/lib/types/rails/string.rb +3 -0
  119. data/lib/types/rails/time.rb +1 -0
  120. data/rdl.gemspec +2 -2
  121. data/test/disabled_test_rdoc.rb +8 -8
  122. data/test/test_alias.rb +1 -0
  123. data/test/test_dsl.rb +4 -4
  124. data/test/test_generic.rb +45 -38
  125. data/test/test_intersection.rb +10 -10
  126. data/test/test_le.rb +103 -102
  127. data/test/test_member.rb +33 -33
  128. data/test/test_parser.rb +101 -96
  129. data/test/test_query.rb +84 -84
  130. data/test/test_rdl.rb +87 -52
  131. data/test/test_rdl_type.rb +26 -9
  132. data/test/test_type_contract.rb +32 -31
  133. data/test/test_typecheck.rb +802 -436
  134. data/test/test_types.rb +39 -39
  135. data/test/test_wrap.rb +3 -2
  136. metadata +91 -120
  137. data/extras/type_tests/%.rb +0 -171
  138. data/extras/type_tests/&.rb +0 -159
  139. data/extras/type_tests/**.rb +0 -222
  140. data/extras/type_tests/*.rb +0 -177
  141. data/extras/type_tests/+.rb +0 -170
  142. data/extras/type_tests/-.rb +0 -171
  143. data/extras/type_tests/1scomp.rb +0 -157
  144. data/extras/type_tests/<.rb +0 -170
  145. data/extras/type_tests/<<.rb +0 -159
  146. data/extras/type_tests/>>.rb +0 -159
  147. data/extras/type_tests/[].rb +0 -163
  148. data/extras/type_tests/^.rb +0 -159
  149. data/extras/type_tests/abs.rb +0 -155
  150. data/extras/type_tests/abs2.rb +0 -164
  151. data/extras/type_tests/angle.rb +0 -157
  152. data/extras/type_tests/arg.rb +0 -157
  153. data/extras/type_tests/bit_length.rb +0 -157
  154. data/extras/type_tests/ceil.rb +0 -157
  155. data/extras/type_tests/ceilRational.rb +0 -160
  156. data/extras/type_tests/conj.rb +0 -158
  157. data/extras/type_tests/defwhere.rb +0 -86
  158. data/extras/type_tests/denominator.rb +0 -157
  159. data/extras/type_tests/div.rb +0 -172
  160. data/extras/type_tests/divslash.rb +0 -179
  161. data/extras/type_tests/even?.rb +0 -157
  162. data/extras/type_tests/fdiv.rb +0 -244
  163. data/extras/type_tests/finite?.rb +0 -157
  164. data/extras/type_tests/floor.rb +0 -157
  165. data/extras/type_tests/floorRational.rb +0 -161
  166. data/extras/type_tests/hash.rb +0 -157
  167. data/extras/type_tests/imag.rb +0 -158
  168. data/extras/type_tests/infinite?.rb +0 -157
  169. data/extras/type_tests/modulo.rb +0 -171
  170. data/extras/type_tests/nan?.rb +0 -157
  171. data/extras/type_tests/neg.rb +0 -155
  172. data/extras/type_tests/next.rb +0 -157
  173. data/extras/type_tests/next_float.rb +0 -157
  174. data/extras/type_tests/numerator.rb +0 -157
  175. data/extras/type_tests/phase.rb +0 -157
  176. data/extras/type_tests/prev_float.rb +0 -157
  177. data/extras/type_tests/quo.rb +0 -179
  178. data/extras/type_tests/rationalize.rb +0 -157
  179. data/extras/type_tests/rationalizeArg.rb +0 -198
  180. data/extras/type_tests/real.rb +0 -157
  181. data/extras/type_tests/real?.rb +0 -157
  182. data/extras/type_tests/round.rb +0 -157
  183. data/extras/type_tests/roundArg.rb +0 -169
  184. data/extras/type_tests/size.rb +0 -157
  185. data/extras/type_tests/to_c.rb +0 -157
  186. data/extras/type_tests/to_f.rb +0 -155
  187. data/extras/type_tests/to_i.rb +0 -157
  188. data/extras/type_tests/to_r.rb +0 -157
  189. data/extras/type_tests/to_s.rb +0 -157
  190. data/extras/type_tests/truncate.rb +0 -157
  191. data/extras/type_tests/truncateArg.rb +0 -166
  192. data/extras/type_tests/type tests +0 -1
  193. data/extras/type_tests/zero?.rb +0 -155
  194. data/extras/type_tests/|.rb +0 -159
  195. data/lib/types/core-ruby-2.x/_aliases.rb +0 -15
  196. data/lib/types/core-ruby-2.x/abbrev.rb +0 -5
  197. data/lib/types/core-ruby-2.x/array.rb +0 -137
  198. data/lib/types/core-ruby-2.x/base64.rb +0 -10
  199. data/lib/types/core-ruby-2.x/basic_object.rb +0 -14
  200. data/lib/types/core-ruby-2.x/benchmark.rb +0 -11
  201. data/lib/types/core-ruby-2.x/bigdecimal.rb +0 -224
  202. data/lib/types/core-ruby-2.x/bigmath.rb +0 -12
  203. data/lib/types/core-ruby-2.x/bignum.rb +0 -214
  204. data/lib/types/core-ruby-2.x/class.rb +0 -17
  205. data/lib/types/core-ruby-2.x/complex.rb +0 -124
  206. data/lib/types/core-ruby-2.x/coverage.rb +0 -6
  207. data/lib/types/core-ruby-2.x/csv.rb +0 -5
  208. data/lib/types/core-ruby-2.x/date.rb +0 -6
  209. data/lib/types/core-ruby-2.x/dir.rb +0 -38
  210. data/lib/types/core-ruby-2.x/encoding.rb +0 -23
  211. data/lib/types/core-ruby-2.x/enumerable.rb +0 -98
  212. data/lib/types/core-ruby-2.x/enumerator.rb +0 -26
  213. data/lib/types/core-ruby-2.x/exception.rb +0 -17
  214. data/lib/types/core-ruby-2.x/file.rb +0 -126
  215. data/lib/types/core-ruby-2.x/fileutils.rb +0 -6
  216. data/lib/types/core-ruby-2.x/fixnum.rb +0 -213
  217. data/lib/types/core-ruby-2.x/float.rb +0 -199
  218. data/lib/types/core-ruby-2.x/gem.rb +0 -247
  219. data/lib/types/core-ruby-2.x/hash.rb +0 -72
  220. data/lib/types/core-ruby-2.x/integer.rb +0 -197
  221. data/lib/types/core-ruby-2.x/io.rb +0 -103
  222. data/lib/types/core-ruby-2.x/kernel.rb +0 -90
  223. data/lib/types/core-ruby-2.x/marshal.rb +0 -5
  224. data/lib/types/core-ruby-2.x/matchdata.rb +0 -26
  225. data/lib/types/core-ruby-2.x/math.rb +0 -53
  226. data/lib/types/core-ruby-2.x/module.rb +0 -83
  227. data/lib/types/core-ruby-2.x/nil.rb +0 -12
  228. data/lib/types/core-ruby-2.x/numeric.rb +0 -56
  229. data/lib/types/core-ruby-2.x/object.rb +0 -75
  230. data/lib/types/core-ruby-2.x/pathname.rb +0 -106
  231. data/lib/types/core-ruby-2.x/proc.rb +0 -16
  232. data/lib/types/core-ruby-2.x/process.rb +0 -127
  233. data/lib/types/core-ruby-2.x/random.rb +0 -17
  234. data/lib/types/core-ruby-2.x/range.rb +0 -39
  235. data/lib/types/core-ruby-2.x/rational.rb +0 -209
  236. data/lib/types/core-ruby-2.x/regexp.rb +0 -30
  237. data/lib/types/core-ruby-2.x/set.rb +0 -58
  238. data/lib/types/core-ruby-2.x/string.rb +0 -143
  239. data/lib/types/core-ruby-2.x/strscan.rb +0 -7
  240. data/lib/types/core-ruby-2.x/symbol.rb +0 -29
  241. data/lib/types/core-ruby-2.x/time.rb +0 -68
  242. data/lib/types/core-ruby-2.x/uri.rb +0 -20
  243. data/lib/types/core-ruby-2.x/yaml.rb +0 -5
  244. data/lib/types/rails-5.x/_helpers.rb +0 -52
  245. data/lib/types/rails-5.x/action_controller/mime_responds.rb +0 -11
  246. data/lib/types/rails-5.x/action_dispatch/routing.rb +0 -10
  247. data/lib/types/rails-5.x/active_model/errors.rb +0 -15
  248. data/lib/types/rails-5.x/active_model/validations.rb +0 -5
  249. data/lib/types/rails-5.x/active_record/associations.rb +0 -190
  250. data/lib/types/rails-5.x/active_record/core.rb +0 -3
  251. data/lib/types/rails-5.x/active_record/model_schema.rb +0 -39
  252. 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, $__rdl_symbol_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($__rdl_hash_type, domain_type, range_type)
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
@@ -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 $__rdl_type_params[base.name]
43
- # formals = $__rdl_type_params[base.name][0]
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 $__rdl_type_params[base.name][0].zip(@params).to_h
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.nil_type?
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 $__rdl_nil_type if ts.size == 0
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
@@ -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] }
@@ -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]] }
@@ -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
- check_arg_preds(bind, preds) if preds.size > 0
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
- bind.local_variable_set(t.name.to_sym,args[actual])
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
- $__rdl_contract_switch.off {
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
- $__rdl_contract_switch.off {
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
- $__rdl_contract_switch.off {
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
- $__rdl_contract_switch.off {
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
@@ -40,7 +40,16 @@ module RDL::Type
40
40
  end
41
41
 
42
42
  def to_s
43
- return @name
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
@@ -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 = $__rdl_nil_type
113
+ result = RDL::Globals.types[:nil]
114
114
  elsif val[0] == 'true' then
115
- result = $__rdl_true_type
115
+ result = RDL::Globals.types[:true]
116
116
  elsif val[0] == 'false'
117
- result = $__rdl_false_type
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 $__rdl_special_types.has_key? val[0] then
126
- result = $__rdl_special_types[val[0]]
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
- | ID LESS type_expr_comma_list GREATER {
132
- n = RDL::Type::NominalType.new(val[0])
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 {
@@ -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', 162)
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
- 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,
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, 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 ]
60
+ nil, nil, nil, 17, nil, 18 ]
61
61
 
62
62
  racc_action_check = [
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 ]
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
- 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 ]
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, -48,
120
- -63, -63, -38, -63, -63, -63, -63, -43, -63, -63,
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, -49, -53, -39, -40, -63, -42, -45, -9,
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, 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,
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, 98, 85, 86, 42, 88, nil, nil, nil, 100,
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, 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,
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, 18, 9, 10, 13, 10, nil, nil, nil, 16,
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, 4,
157
- 5, nil, nil, -9, -44, -34, -9, nil, -12, -3 ]
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 = $__rdl_nil_type
701
+ result = RDL::Globals.types[:nil]
702
702
  elsif val[0] == 'true' then
703
- result = $__rdl_true_type
703
+ result = RDL::Globals.types[:true]
704
704
  elsif val[0] == 'false'
705
- result = $__rdl_false_type
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 $__rdl_special_types.has_key? val[0] then
719
- result = $__rdl_special_types[val[0]]
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
- n = RDL::Type::NominalType.new(val[0])
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', 134)
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', 136)
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', 139)
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', 142)
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', 145)
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', 147)
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', 148)
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', 150)
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', 154)
797
+ module_eval(<<'.,.,', 'parser.racc', 153)
799
798
  def _reduce_62(val, _values, result)
800
799
  result = RDL::Type::WildQuery.new
801
800
  result