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.
@@ -40,5 +40,13 @@ module RDL::Type
40
40
  def instantiate(inst)
41
41
  return AnnotatedArgType.new(@name, @type.instantiate(inst))
42
42
  end
43
+
44
+ def optional?
45
+ return type.optional?
46
+ end
47
+
48
+ def vararg?
49
+ return type.vararg?
50
+ end
43
51
  end
44
52
  end
@@ -1,22 +1,25 @@
1
1
  require_relative 'type'
2
2
 
3
3
  module RDL::Type
4
- # A specialized GenericType for fixed-sized maps from values to
5
- # types, for "named" arguments in Ruby. Values are compared with ==
6
- # to see if they match.
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
- @the_hash = GenericType.new($__rdl_hash_type, $__rdl_symbol_type, UnionType.new(*@elts.values))
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
- rest = @elts.clone # shallow copy
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
- return false unless @elts.has_key? k
82
- t = @elts[k]
83
- t = t.type if t.instance_of? OptionalType
84
- return false unless t.member? v
85
- rest.delete(k)
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
- rest.each_pair { |k, vt|
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
@@ -27,6 +27,7 @@ rule
27
27
  , { [:COMMA, text] }
28
28
  \? { [:QUERY, text] }
29
29
  \! { [:BANG, text] }
30
+ \*\* { [:STARSTAR, text] }
30
31
  \* { [:STAR, text] }
31
32
  \#T { [:HASH_TYPE, text] }
32
33
  \#Q { [:HASH_QUERY, text] }
@@ -106,6 +106,9 @@ class Parser < Racc::Parser
106
106
  when (text = @ss.scan(/\!/))
107
107
  action { [:BANG, text] }
108
108
 
109
+ when (text = @ss.scan(/\*\*/))
110
+ action { [:STARSTAR, text] }
111
+
109
112
  when (text = @ss.scan(/\*/))
110
113
  action { [:STAR, text] }
111
114
 
@@ -41,7 +41,11 @@ module RDL::Type
41
41
  }
42
42
  @args = *args
43
43
 
44
- raise "Block must be MethodType" unless (not block) or (block.instance_of? MethodType)
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
- next unless blk
65
- blk = block_wrap(slf, inst, @block, bind, &blk)
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}"
@@ -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.instance_of? UnionType
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
@@ -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
- | named_arg COMMA named_arg_list { result = val[0] + val[2] }
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
- | hash_expr COMMA hash_expr_comma_list { result = val[0] + val[2] }
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) }
@@ -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', 159)
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, 77, 19, 20, 79, 22, 29, 31, 14, 16,
25
- 82, 40, 11, 88, 17, 59, 18, 73, 32, 13,
26
- 33, 21, 91, 19, 20, 7, 22, 29, 31, 14,
27
- 16, 96, 39, 11, 39, 17, 7, 18, 99, 32,
28
- 13, 33, 21, 100, 19, 20, 102, 22, 104, 15,
29
- 14, 16, 106, 5, 6, 73, 17, 21, 18, 19,
30
- 20, 13, 22, 107, 15, 14, 16, 7, 8, 7,
31
- 35, 17, 21, 18, 19, 20, 13, 22, 37, 15,
32
- 14, 16, 39, 54, 55, 56, 17, 21, 18, 19,
33
- 20, 13, 22, 57, 15, 14, 16, 58, 62, 11,
34
- 64, 17, 21, 18, 19, 20, 13, 22, 59, 15,
35
- 14, 16, 66, 67, 68, 69, 17, 21, 18, 19,
36
- 20, 13, 22, 70, 15, 14, 16, 71, 72, 11,
37
- 74, 17, 21, 18, 19, 20, 13, 22, 75, 15,
38
- 14, 16, 76, nil, 11, nil, 17, nil, 18, nil,
39
- 85, 13, 21, nil, 19, 20, nil, 22, nil, 15,
40
- 14, 16, nil, nil, 11, nil, 17, 21, 18, 19,
41
- 20, 13, 22, nil, 15, 14, 16, nil, nil, nil,
42
- nil, 17, 21, 18, 19, 20, 13, 22, nil, 15,
43
- 14, 16, nil, nil, 11, nil, 17, 21, 18, 19,
44
- 20, 13, 22, nil, 15, 14, 16, nil, nil, 11,
45
- nil, 17, 21, 18, 19, 20, 13, 22, nil, 15,
46
- 14, 16, nil, nil, 11, nil, 17, 21, 18, 19,
47
- 20, 13, 22, nil, 15, 14, 16, nil, nil, nil,
48
- nil, 17, 21, 18, 19, 20, 13, 22, nil, 15,
49
- 14, 16, nil, nil, 11, nil, 17, 21, 18, 19,
50
- 20, 13, 22, nil, 15, 14, 16, nil, nil, 11,
51
- nil, 17, 21, 18, 19, 20, 13, 22, nil, 49,
52
- 14, 16, nil, nil, 11, nil, 17, nil, 18, 53,
53
- 21, 13, 19, 20, nil, 22, nil, 15, 14, 16,
54
- 44, nil, 42, 43, 17, nil, 18, 40, nil, nil,
55
- 45, 44, 7, 42, 43, nil, nil, nil, 40, nil,
56
- nil, 45 ]
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
- 56, 54, 56, 56, 55, 56, 56, 56, 56, 56,
60
- 57, 58, 56, 65, 56, 31, 56, 49, 56, 56,
61
- 56, 7, 68, 7, 7, 73, 7, 7, 7, 7,
62
- 7, 78, 31, 7, 49, 7, 79, 7, 91, 7,
63
- 7, 7, 64, 94, 64, 64, 97, 64, 100, 64,
64
- 64, 64, 101, 0, 0, 104, 64, 66, 64, 66,
65
- 66, 64, 66, 106, 66, 66, 66, 0, 1, 6,
66
- 8, 66, 67, 66, 67, 67, 66, 67, 12, 67,
67
- 67, 67, 15, 21, 24, 27, 67, 32, 67, 32,
68
- 32, 67, 32, 28, 32, 32, 32, 30, 36, 32,
69
- 38, 32, 69, 32, 69, 69, 32, 69, 40, 69,
70
- 69, 69, 42, 43, 44, 45, 69, 5, 69, 5,
71
- 5, 69, 5, 46, 5, 5, 5, 47, 48, 5,
72
- 50, 5, 59, 5, 59, 59, 5, 59, 51, 59,
73
- 59, 59, 52, nil, 59, nil, 59, nil, 59, nil,
74
- 59, 59, 85, nil, 85, 85, nil, 85, nil, 85,
75
- 85, 85, nil, nil, 85, nil, 85, 37, 85, 37,
76
- 37, 85, 37, nil, 37, 37, 37, nil, nil, nil,
77
- nil, 37, 11, 37, 11, 11, 37, 11, nil, 11,
78
- 11, 11, nil, nil, 11, nil, 11, 96, 11, 96,
79
- 96, 11, 96, nil, 96, 96, 96, nil, nil, 96,
80
- nil, 96, 39, 96, 39, 39, 96, 39, nil, 39,
81
- 39, 39, nil, nil, 39, nil, 39, 99, 39, 99,
82
- 99, 39, 99, nil, 99, 99, 99, nil, nil, nil,
83
- nil, 99, 33, 99, 33, 33, 99, 33, nil, 33,
84
- 33, 33, nil, nil, 33, nil, 33, 74, 33, 74,
85
- 74, 33, 74, nil, 74, 74, 74, nil, nil, 74,
86
- nil, 74, 18, 74, 18, 18, 74, 18, nil, 18,
87
- 18, 18, nil, nil, 18, nil, 18, nil, 18, 18,
88
- 13, 18, 13, 13, nil, 13, nil, 13, 13, 13,
89
- 17, nil, 17, 17, 13, nil, 13, 17, nil, nil,
90
- 17, 70, 17, 70, 70, nil, nil, nil, 70, nil,
91
- nil, 70 ]
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
- 48, 68, nil, nil, nil, 110, 50, 14, 70, nil,
95
- nil, 175, 74, 283, nil, 54, nil, 293, 265, nil,
96
- nil, 69, nil, nil, 64, nil, nil, 83, 79, nil,
97
- 95, 4, 80, 235, nil, nil, 78, 160, 96, 205,
98
- 97, nil, 104, 105, 100, 107, 121, 105, 106, 6,
99
- 128, 114, 118, nil, -21, -17, -7, -8, -3, 125,
100
- nil, nil, nil, nil, 35, -16, 50, 65, 0, 95,
101
- 304, nil, nil, 6, 250, nil, nil, nil, 28, 17,
102
- nil, nil, nil, nil, nil, 145, nil, nil, nil, nil,
103
- nil, 30, nil, nil, 41, nil, 190, 24, nil, 220,
104
- 34, 38, nil, nil, 44, nil, 45, nil ]
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
- -60, -60, -1, -2, -3, -60, -60, -11, -60, -4,
108
- -31, -60, -43, -60, -47, -48, -49, -35, -60, -56,
109
- -57, -60, -59, -5, -60, -12, -13, -14, -17, -20,
110
- -21, -48, -60, -60, -26, 108, -60, -60, -45, -60,
111
- -60, -36, -60, -60, -60, -60, -41, -60, -60, -48,
112
- -33, -60, -60, -54, -60, -29, -60, -19, -60, -60,
113
- -24, -25, -32, -44, -60, -60, -60, -60, -60, -60,
114
- -35, -51, -55, -60, -60, -52, -53, -58, -60, -60,
115
- -15, -16, -18, -22, -23, -60, -28, -46, -50, -37,
116
- -38, -60, -40, -42, -9, -34, -60, -60, -27, -60,
117
- -60, -6, -30, -39, -60, -10, -7, -8 ]
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, 52, 34, 2, 63, 51, 36, 41, 26, 23,
121
- 48, 38, 3, 25, 4, 24, 78, 84, 1, nil,
122
- 47, nil, nil, nil, nil, nil, 65, 60, 61, nil,
123
- nil, 87, nil, 89, 90, nil, 92, nil, nil, nil,
124
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
125
- nil, 34, nil, nil, 86, nil, nil, 81, nil, 83,
126
- 41, 95, 80, 93, nil, nil, 103, nil, nil, nil,
127
- nil, nil, nil, nil, nil, nil, 94, nil, nil, nil,
128
- 98, nil, 97, 105, nil, nil, nil, nil, nil, nil,
129
- nil, 101 ]
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, 2, 15, 16, 5, 13, 10, 2,
133
- 18, 19, 3, 9, 4, 6, 7, 14, 1, nil,
134
- 2, nil, nil, nil, nil, nil, 16, 5, 5, nil,
135
- nil, 15, nil, 15, 15, nil, 15, nil, nil, nil,
136
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
137
- nil, 5, nil, nil, 5, nil, nil, 10, nil, 10,
138
- 13, 16, 9, 18, nil, nil, 15, nil, nil, nil,
139
- nil, nil, nil, nil, nil, nil, 2, nil, nil, nil,
140
- 5, nil, 2, 8, nil, nil, nil, nil, nil, nil,
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, 18, 3, 12, 14, -5, 8, -39, -17, 6,
145
- 1, nil, nil, -10, -42, -33, -13, nil, -7, -2 ]
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, 50, nil, nil, nil, nil,
149
- nil, 27, 28, 30, nil, 10, nil, 46, nil, 12 ]
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, 32, :_reduce_1,
154
- 1, 32, :_reduce_2,
155
- 1, 32, :_reduce_3,
156
- 2, 34, :_reduce_4,
157
- 2, 35, :_reduce_5,
158
- 6, 33, :_reduce_6,
159
- 7, 33, :_reduce_7,
160
- 8, 33, :_reduce_8,
161
- 3, 39, :_reduce_9,
162
- 5, 39, :_reduce_10,
163
- 0, 37, :_reduce_11,
164
- 1, 37, :_reduce_12,
165
- 1, 37, :_reduce_13,
166
- 1, 40, :_reduce_14,
167
- 3, 40, :_reduce_15,
168
- 3, 40, :_reduce_16,
169
- 1, 42, :_reduce_17,
170
- 3, 42, :_reduce_18,
171
- 2, 42, :_reduce_19,
172
- 1, 42, :_reduce_20,
173
- 1, 41, :_reduce_21,
174
- 3, 41, :_reduce_22,
175
- 3, 44, :_reduce_23,
176
- 2, 43, :_reduce_24,
177
- 2, 43, :_reduce_25,
178
- 1, 43, :_reduce_26,
179
- 2, 45, :_reduce_27,
180
- 1, 45, :_reduce_28,
181
- 0, 38, :_reduce_29,
182
- 3, 38, :_reduce_30,
183
- 1, 36, :_reduce_31,
184
- 3, 36, :_reduce_32,
185
- 1, 47, :_reduce_33,
186
- 3, 47, :_reduce_34,
187
- 0, 48, :_reduce_none,
188
- 1, 48, :_reduce_36,
189
- 3, 48, :_reduce_37,
190
- 3, 48, :_reduce_38,
191
- 5, 48, :_reduce_39,
192
- 3, 48, :_reduce_40,
193
- 1, 49, :_reduce_41,
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, 46, :_reduce_43,
196
- 3, 46, :_reduce_44,
197
- 2, 46, :_reduce_45,
198
- 4, 46, :_reduce_46,
199
- 1, 50, :_reduce_47,
200
- 1, 50, :_reduce_48,
201
- 1, 50, :_reduce_49,
202
- 4, 50, :_reduce_50,
203
- 3, 50, :_reduce_51,
204
- 3, 50, :_reduce_52,
205
- 3, 50, :_reduce_53,
206
- 2, 50, :_reduce_54,
207
- 3, 50, :_reduce_55,
208
- 1, 50, :_reduce_56,
209
- 1, 50, :_reduce_57,
210
- 3, 50, :_reduce_58,
211
- 1, 50, :_reduce_59 ]
212
-
213
- racc_reduce_n = 60
214
-
215
- racc_shift_n = 108
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
- :STAR => 27,
246
- :LESS => 28,
247
- :GREATER => 29,
248
- :EOF => 30 }
260
+ :STARSTAR => 27,
261
+ :STAR => 28,
262
+ :LESS => 29,
263
+ :GREATER => 30,
264
+ :EOF => 31 }
249
265
 
250
- racc_nt_base = 31
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
- result = RDL::Type::DependentArgType.new(val[1], val[0], val[2])
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 = val[0] + val[2]
501
+ result = [[], val[1]]
485
502
  result
486
503
  end
487
504
  .,.,
488
505
 
489
- module_eval(<<'.,.,', 'parser.racc', 64)
506
+ module_eval(<<'.,.,', 'parser.racc', 63)
490
507
  def _reduce_23(val, _values, result)
491
- result = [val[0].to_sym, val[2]]
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', 67)
513
+ module_eval(<<'.,.,', 'parser.racc', 65)
497
514
  def _reduce_24(val, _values, result)
498
- result = RDL::Type::OptionalType.new val[1]
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::VarargType.new val[1]
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[0]
529
+ result = RDL::Type::VarargType.new val[1]
513
530
  result
514
531
  end
515
532
  .,.,
516
533
 
517
- module_eval(<<'.,.,', 'parser.racc', 71)
534
+ module_eval(<<'.,.,', 'parser.racc', 70)
518
535
  def _reduce_27(val, _values, result)
519
- result = RDL::Type::OptionalType.new val[1]
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[0]
543
+ result = RDL::Type::OptionalType.new val[1]
527
544
  result
528
545
  end
529
546
  .,.,
530
547
 
531
- module_eval(<<'.,.,', 'parser.racc', 75)
548
+ module_eval(<<'.,.,', 'parser.racc', 73)
532
549
  def _reduce_29(val, _values, result)
533
- result = nil
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 = val[1]
557
+ result = nil
541
558
  result
542
559
  end
543
560
  .,.,
544
561
 
545
- module_eval(<<'.,.,', 'parser.racc', 79)
562
+ module_eval(<<'.,.,', 'parser.racc', 77)
546
563
  def _reduce_31(val, _values, result)
547
- result = val[0]
564
+ result = val[1]
548
565
  result
549
566
  end
550
567
  .,.,
551
568
 
552
- module_eval(<<'.,.,', 'parser.racc', 80)
569
+ module_eval(<<'.,.,', 'parser.racc', 78)
553
570
  def _reduce_32(val, _values, result)
554
- result = val[1]
571
+ result = RDL::Type::OptionalType.new val[2]
555
572
  result
556
573
  end
557
574
  .,.,
558
575
 
559
- module_eval(<<'.,.,', 'parser.racc', 83)
576
+ module_eval(<<'.,.,', 'parser.racc', 81)
560
577
  def _reduce_33(val, _values, result)
561
- result = [val[0]]
578
+ result = val[0]
562
579
  result
563
580
  end
564
581
  .,.,
565
582
 
566
- module_eval(<<'.,.,', 'parser.racc', 84)
583
+ module_eval(<<'.,.,', 'parser.racc', 82)
567
584
  def _reduce_34(val, _values, result)
568
- result = [val[0]] + val[2]
585
+ result = val[1]
569
586
  result
570
587
  end
571
588
  .,.,
572
589
 
573
- # reduce 35 omitted
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', 87)
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', 88)
583
- def _reduce_37(val, _values, result)
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', 89)
590
- def _reduce_38(val, _values, result)
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', 91)
597
- def _reduce_39(val, _values, result)
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', 93)
605
- def _reduce_40(val, _values, result)
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', 96)
612
- def _reduce_41(val, _values, result)
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', 97)
619
- def _reduce_42(val, _values, result)
620
- result = val[0] + val[2]
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 _reduce_43(val, _values, result)
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', 101)
633
- def _reduce_44(val, _values, result)
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', 102)
640
- def _reduce_45(val, _values, result)
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', 103)
647
- def _reduce_46(val, _values, result)
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', 106)
654
- def _reduce_47(val, _values, result)
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', 108)
661
- def _reduce_48(val, _values, result)
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', 121)
679
- def _reduce_49(val, _values, result)
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', 128)
691
- def _reduce_50(val, _values, result)
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', 131)
700
- def _reduce_51(val, _values, result)
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', 133)
707
- def _reduce_52(val, _values, result)
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', 136)
715
- def _reduce_53(val, _values, result)
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', 139)
723
- def _reduce_54(val, _values, result)
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', 142)
731
- def _reduce_55(val, _values, result)
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', 144)
739
- def _reduce_56(val, _values, result)
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', 145)
746
- def _reduce_57(val, _values, result)
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', 147)
753
- def _reduce_58(val, _values, result)
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', 151)
761
- def _reduce_59(val, _values, result)
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