rack-mount 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -101,7 +101,7 @@ module Rack::Mount
101
101
  when Regin::CharacterClass
102
102
  break if separators.any? { |s| part.include?(s) }
103
103
  buf = nil
104
- segments << part.to_regexp
104
+ segments << part.to_regexp(true)
105
105
  when Regin::Character
106
106
  if separators.any? { |s| part.include?(s) }
107
107
  segments << join_buffer(buf, regexp) if buf
@@ -125,7 +125,7 @@ module Rack::Mount
125
125
  elsif part.quantifier == nil
126
126
  break if separators.any? { |s| part.include?(s) }
127
127
  buf = nil
128
- segments << part.to_regexp
128
+ segments << part.to_regexp(true)
129
129
  else
130
130
  break
131
131
  end
@@ -151,7 +151,7 @@ module Rack::Mount
151
151
  if parts.literal?
152
152
  parts.to_s
153
153
  else
154
- parts.to_regexp
154
+ parts.to_regexp(true)
155
155
  end
156
156
  end
157
157
  end
@@ -119,7 +119,7 @@ module Rack::Mount
119
119
  end
120
120
  when Regin::Group
121
121
  if part.name
122
- s << DynamicSegment.new(part.name, part.expression.to_regexp)
122
+ s << DynamicSegment.new(part.name, part.expression.to_regexp(true))
123
123
  else
124
124
  s << parse_segments(part.expression)
125
125
  end
@@ -12,7 +12,8 @@ rule
12
12
  }
13
13
  | GLOB {
14
14
  name = val[0].to_sym
15
- result = REGEXP_NAMED_CAPTURE % [name, '.+']
15
+ requirement = requirements[name]
16
+ result = REGEXP_NAMED_CAPTURE % [name, '.+' || requirement]
16
17
  }
17
18
  | LPAREN expr RPAREN { result = "(?:#{val[1]})?" }
18
19
  | CHAR { result = Regexp.escape(val[0]) }
@@ -1,15 +1,5 @@
1
1
  module Regin
2
2
  class Alternation < Collection
3
- def self.reduce(alternation_or_expression, expression) #:nodoc:
4
- if alternation_or_expression.first.is_a?(Alternation)
5
- alternation_or_expression = alternation_or_expression.first
6
- alternation_or_expression += [expression]
7
- new(*alternation_or_expression)
8
- else
9
- new(alternation_or_expression, expression)
10
- end
11
- end
12
-
13
3
  def initialize(*args)
14
4
  args, options = extract_options(args)
15
5
 
@@ -50,10 +50,5 @@ module Regin
50
50
  self.value.eql?(other.value) &&
51
51
  (!!self.ignorecase).eql?(!!other.ignorecase)
52
52
  end
53
-
54
- def freeze #:nodoc:
55
- value.freeze
56
- super
57
- end
58
53
  end
59
54
  end
@@ -26,12 +26,14 @@ module Regin
26
26
  end
27
27
  end
28
28
 
29
- def to_regexp
30
- Regexp.compile("\\A#{to_s(true)}\\Z", ignorecase)
29
+ def to_regexp(anchored = false)
30
+ re = to_s(true)
31
+ re = "\\A#{re}\\Z" if anchored
32
+ Regexp.compile(re, ignorecase)
31
33
  end
32
34
 
33
35
  def match(char)
34
- to_regexp.match(char)
36
+ to_regexp(true).match(char)
35
37
  end
36
38
 
37
39
  def include?(char)
@@ -45,10 +47,5 @@ module Regin
45
47
  def eql?(other) #:nodoc:
46
48
  super && quantifier.eql?(other.quantifier)
47
49
  end
48
-
49
- def freeze #:nodoc:
50
- quantifier.freeze if quantifier
51
- super
52
- end
53
50
  end
54
51
  end
@@ -46,10 +46,5 @@ module Regin
46
46
  def eql?(other) #:nodoc:
47
47
  super && negate == other.negate
48
48
  end
49
-
50
- def freeze #:nodoc:
51
- negate.freeze if negate
52
- super
53
- end
54
49
  end
55
50
  end
@@ -6,8 +6,8 @@ module Regin
6
6
  @array = Array.new(*args)
7
7
  end
8
8
 
9
- def each(&block)
10
- @array.each(&block)
9
+ def each
10
+ @array.each{ |item| yield item }
11
11
  end
12
12
 
13
13
  def [](i)
@@ -28,12 +28,14 @@ module Regin
28
28
  end
29
29
 
30
30
  def +(other)
31
- ary = other.is_a?(Collection) ? other.internal_array : other
31
+ ary = other.is_a?(self.class) ? other.internal_array : other
32
32
  self.class.new(@array + ary)
33
33
  end
34
34
 
35
- def to_regexp
36
- Regexp.compile("\\A#{to_s(true)}\\Z", flags)
35
+ def to_regexp(anchored = false)
36
+ re = to_s(true)
37
+ re = "\\A#{re}\\Z" if anchored
38
+ Regexp.compile(re, flags)
37
39
  end
38
40
 
39
41
  def match(char)
@@ -59,12 +61,6 @@ module Regin
59
61
  other.instance_of?(self.class) && @array.eql?(other.internal_array)
60
62
  end
61
63
 
62
- def freeze #:nodoc:
63
- each { |e| e.freeze }
64
- @array.freeze
65
- super
66
- end
67
-
68
64
  protected
69
65
  def internal_array #:nodoc:
70
66
  @array
@@ -1,18 +1,6 @@
1
1
  module Regin
2
2
  class Expression < Collection
3
- attr_reader :ignorecase
4
- attr_accessor :multiline, :extended
5
-
6
- def self.reduce(expression_or_atom, atom = nil) #:nodoc:
7
- if expression_or_atom.is_a?(Expression)
8
- expression_or_atom += [atom] if atom
9
- new(*expression_or_atom)
10
- elsif atom.nil?
11
- new(expression_or_atom)
12
- else
13
- new(expression_or_atom, atom)
14
- end
15
- end
3
+ attr_reader :ignorecase, :multiline, :extended
16
4
 
17
5
  def initialize(*args)
18
6
  args, options = extract_options(args)
@@ -70,6 +58,12 @@ module Regin
70
58
  options.to_i
71
59
  end
72
60
 
61
+ def +(other)
62
+ ary = other.is_a?(self.class) ? other.internal_array : other
63
+ ary = @array + ary + [options.to_h(true)]
64
+ self.class.new(*ary)
65
+ end
66
+
73
67
  def dup(options = {})
74
68
  expression = super()
75
69
  expression.multiline = options[:multiline] if options.key?(:multiline)
@@ -114,11 +108,19 @@ module Regin
114
108
  Options.new(multiline, ignorecase, extended)
115
109
  end
116
110
 
111
+ def multiline=(multiline)
112
+ @multiline = multiline
113
+ end
114
+
117
115
  def ignorecase=(ignorecase)
118
116
  if @ignorecase.nil?
119
117
  @array.map! { |e| e.dup(:ignorecase => ignorecase) }
120
118
  @ignorecase = ignorecase
121
119
  end
122
120
  end
121
+
122
+ def extended=(extended)
123
+ @extended = extended
124
+ end
123
125
  end
124
126
  end
@@ -34,8 +34,10 @@ module Regin
34
34
  end
35
35
  end
36
36
 
37
- def to_regexp
38
- Regexp.compile("\\A#{to_s}\\Z")
37
+ def to_regexp(anchored = false)
38
+ re = to_s
39
+ re = "\\A#{re}\\Z" if anchored
40
+ Regexp.compile(re)
39
41
  end
40
42
 
41
43
  def dup(options = {})
@@ -79,10 +81,5 @@ module Regin
79
81
  self.index == other.index &&
80
82
  self.name == other.name
81
83
  end
82
-
83
- def freeze #:nodoc:
84
- expression.freeze if expression
85
- super
86
- end
87
84
  end
88
85
  end
@@ -30,10 +30,18 @@ module Regin
30
30
  end
31
31
  end
32
32
 
33
- def to_h
34
- { :multiline => multiline,
35
- :ignorecase => ignorecase,
36
- :extended => extended }
33
+ def to_h(explicit = false)
34
+ if explicit
35
+ options = {}
36
+ options[:multiline] = multiline unless multiline.nil?
37
+ options[:ignorecase] = ignorecase unless ignorecase.nil?
38
+ options[:extended] = extended unless extended.nil?
39
+ options
40
+ else
41
+ { :multiline => multiline,
42
+ :ignorecase => ignorecase,
43
+ :extended => extended }
44
+ end
37
45
  end
38
46
 
39
47
  def to_i
@@ -6,7 +6,7 @@
6
6
 
7
7
  require 'racc/parser.rb'
8
8
  module Regin
9
- class Parser < Racc::Parser #:nodoc: all
9
+ class Parser < Racc::Parser
10
10
 
11
11
  def self.parse_regexp(regexp)
12
12
  options = Options.from_int(regexp.options)
@@ -30,117 +30,124 @@ end
30
30
  ##### State transition tables begin ###
31
31
 
32
32
  racc_action_table = [
33
- 1, 17, 18, 18, 7, 8, 10, 11, 48, 18,
34
- 1, 60, 2, 4, 7, 8, 10, 11, 45, 47,
35
- 1, 55, 2, 4, 7, 8, 10, 11, 28, 18,
36
- 1, 15, 2, 4, 7, 8, 10, 11, 64, 18,
37
- 1, 63, 2, 4, 7, 8, 10, 11, 61, 49,
38
- 1, 27, 2, 4, 7, 8, 10, 11, 36, 25,
39
- 1, 33, 2, 4, 7, 8, 10, 11, nil, nil,
40
- 1, nil, 2, 4, 7, 8, 10, 11, 42, 43,
41
- 46, 31, 2, 4, 32, 20, 44, 37, 39, 41,
42
- 21, 22, 24, 20, 58, 37, 39, 41, 21, 22,
43
- 24, 13, nil, 14, 30, 31, 15, nil, 32, 51,
44
- 37, 39, 41, 37, 39, 41, 37, 39, 41, 37,
45
- 39, 41, 37, 39, 41, 37, 39, 41, 37, 39,
46
- 41 ]
33
+ 3, 41, 42, 43, 9, 11, 13, 15, 52, 59,
34
+ 3, 55, 4, 6, 9, 11, 13, 15, 22, 51,
35
+ 3, 33, 4, 6, 9, 11, 13, 15, 21, 60,
36
+ 3, 61, 4, 6, 9, 11, 13, 15, 20, 19,
37
+ 3, 49, 4, 6, 9, 11, 13, 15, 35, 67,
38
+ 3, 68, 4, 6, 9, 11, 13, 15, 40, 39,
39
+ 3, 38, 4, 6, 9, 11, 13, 15, nil, 29,
40
+ 3, nil, 4, 6, 9, 11, 13, 15, 44, 45,
41
+ 31, nil, 4, 6, 32, 24, 48, 41, 42, 43,
42
+ 25, 26, 27, 17, nil, 18, 50, nil, 19, nil,
43
+ 32, 57, 41, 42, 43, 64, 41, 42, 43, 41,
44
+ 42, 43, 41, 42, 43, 41, 42, 43, 41, 42,
45
+ 43, 41, 42, 43 ]
47
46
 
48
47
  racc_action_check = [
49
- 0, 3, 52, 3, 0, 0, 0, 0, 36, 26,
50
- 49, 52, 0, 0, 49, 49, 49, 49, 26, 36,
51
- 43, 48, 49, 49, 43, 43, 43, 43, 14, 56,
52
- 5, 14, 43, 43, 5, 5, 5, 5, 56, 53,
53
- 34, 55, 5, 5, 34, 34, 34, 34, 53, 38,
54
- 11, 13, 34, 34, 11, 11, 11, 11, 24, 11,
55
- 18, 17, 11, 11, 18, 18, 18, 18, nil, nil,
56
- 42, nil, 18, 18, 42, 42, 42, 42, 25, 25,
57
- 29, 29, 42, 42, 29, 19, 25, 25, 25, 25,
58
- 19, 19, 19, 6, 50, 50, 50, 50, 6, 6,
59
- 6, 1, nil, 1, 16, 16, 1, nil, 16, 40,
60
- 40, 40, 40, 54, 54, 54, 58, 58, 58, 59,
61
- 59, 59, 51, 51, 51, 62, 62, 62, 44, 44,
62
- 44 ]
48
+ 0, 57, 57, 57, 0, 0, 0, 0, 40, 52,
49
+ 22, 46, 0, 0, 22, 22, 22, 22, 8, 40,
50
+ 55, 17, 22, 22, 55, 55, 55, 55, 7, 53,
51
+ 45, 54, 55, 55, 45, 45, 45, 45, 5, 18,
52
+ 44, 30, 45, 45, 44, 44, 44, 44, 20, 59,
53
+ 10, 62, 44, 44, 10, 10, 10, 10, 27, 26,
54
+ 15, 25, 10, 10, 15, 15, 15, 15, nil, 15,
55
+ 21, nil, 15, 15, 21, 21, 21, 21, 29, 29,
56
+ 16, nil, 21, 21, 16, 14, 29, 29, 29, 29,
57
+ 14, 14, 14, 3, nil, 3, 34, nil, 3, nil,
58
+ 34, 47, 47, 47, 47, 56, 56, 56, 56, 58,
59
+ 58, 58, 64, 64, 64, 65, 65, 65, 48, 48,
60
+ 48, 66, 66, 66 ]
63
61
 
64
62
  racc_action_pointer = [
65
- -3, 97, nil, 1, nil, 27, 81, nil, nil, nil,
66
- nil, 47, nil, 46, 22, nil, 99, 61, 57, 73,
67
- nil, nil, nil, nil, 49, 65, 7, nil, nil, 75,
68
- nil, nil, nil, nil, 37, nil, -1, nil, 36, nil,
69
- 88, nil, 67, 17, 106, nil, nil, nil, 12, 7,
70
- 73, 100, 0, 37, 91, 21, 27, nil, 94, 97,
71
- nil, nil, 103, nil, nil, nil, nil, nil ]
63
+ -3, nil, nil, 89, nil, 38, nil, 26, 16, nil,
64
+ 47, nil, nil, nil, 73, 57, 75, 16, 30, nil,
65
+ 48, 67, 7, nil, nil, 49, 47, 49, nil, 65,
66
+ 30, nil, nil, nil, 91, nil, nil, nil, nil, nil,
67
+ -1, nil, nil, nil, 37, 27, -2, 80, 96, nil,
68
+ nil, nil, 0, 18, 20, 17, 84, -21, 87, 29,
69
+ nil, nil, 40, nil, 90, 93, 99, nil, nil, nil,
70
+ nil, nil ]
72
71
 
73
72
  racc_action_default = [
74
- -37, -37, -19, -37, -20, -2, -6, -11, -12, -7,
75
- -14, -37, -13, -37, -29, -28, -37, -37, -37, -4,
76
- -23, -21, -22, -5, -37, -37, -37, -8, -29, -37,
77
- -9, -27, -26, 68, -1, -3, -37, -34, -37, -35,
78
- -37, -36, -37, -37, -37, -15, -10, -25, -37, -37,
79
- -37, -37, -37, -37, -37, -37, -37, -33, -37, -37,
80
- -17, -18, -37, -24, -16, -32, -31, -30 ]
73
+ -40, -10, -16, -40, -22, -40, -23, -1, -2, -14,
74
+ -5, -15, -7, -17, -9, -40, -40, -40, -40, -32,
75
+ -40, -40, -40, -6, -26, -24, -25, -40, -8, -40,
76
+ -40, -12, -31, -11, -40, 72, -3, -4, -27, -28,
77
+ -40, -37, -38, -39, -40, -40, -40, -40, -40, -18,
78
+ -13, -30, -40, -40, -40, -40, -40, -40, -40, -40,
79
+ -20, -21, -40, -36, -40, -40, -40, -29, -19, -35,
80
+ -34, -33 ]
81
81
 
82
82
  racc_goto_table = [
83
- 3, 40, 19, 38, 16, 23, 34, nil, nil, nil,
84
- nil, 26, nil, nil, nil, nil, 50, 29, 35, nil,
85
- 54, nil, nil, nil, nil, nil, 57, 59, nil, nil,
86
- 62, 19, nil, nil, 65, 66, nil, nil, 67, nil,
87
- nil, nil, 52, 53, nil, nil, nil, nil, nil, 56 ]
83
+ 5, 47, 16, 36, 37, 23, 46, 28, nil, nil,
84
+ nil, nil, nil, nil, nil, 30, nil, 34, nil, 56,
85
+ 58, nil, nil, nil, nil, nil, nil, nil, 63, 65,
86
+ 66, nil, nil, nil, nil, nil, 69, 70, 71, nil,
87
+ nil, nil, nil, nil, 53, 54, nil, nil, nil, nil,
88
+ nil, nil, nil, nil, nil, 62 ]
88
89
 
89
90
  racc_goto_check = [
90
- 1, 9, 3, 8, 6, 4, 2, nil, nil, nil,
91
- nil, 1, nil, nil, nil, nil, 9, 6, 4, nil,
92
- 9, nil, nil, nil, nil, nil, 9, 9, nil, nil,
93
- 9, 3, nil, nil, 9, 9, nil, nil, 9, nil,
94
- nil, nil, 1, 1, nil, nil, nil, nil, nil, 1 ]
91
+ 1, 12, 9, 3, 3, 5, 11, 7, nil, nil,
92
+ nil, nil, nil, nil, nil, 1, nil, 9, nil, 12,
93
+ 12, nil, nil, nil, nil, nil, nil, nil, 12, 12,
94
+ 12, nil, nil, nil, nil, nil, 12, 12, 12, nil,
95
+ nil, nil, nil, nil, 1, 1, nil, nil, nil, nil,
96
+ nil, nil, nil, nil, nil, 1 ]
95
97
 
96
98
  racc_goto_pointer = [
97
- nil, 0, -12, -3, -1, nil, 3, nil, -22, -24 ]
99
+ nil, 0, nil, -18, nil, -5, nil, -7, nil, -1,
100
+ nil, -23, -28 ]
98
101
 
99
102
  racc_goto_default = [
100
- nil, nil, 5, 6, nil, 9, nil, 12, nil, nil ]
103
+ nil, nil, 7, 8, 10, 12, 14, nil, 1, nil,
104
+ 2, nil, nil ]
101
105
 
102
106
  racc_reduce_table = [
103
107
  0, 0, :racc_error,
104
- 3, 26, :_reduce_1,
105
- 1, 26, :_reduce_2,
108
+ 1, 26, :_reduce_1,
109
+ 1, 26, :_reduce_none,
106
110
  3, 27, :_reduce_3,
107
- 2, 27, :_reduce_4,
108
- 2, 27, :_reduce_5,
109
- 1, 27, :_reduce_none,
110
- 1, 28, :_reduce_none,
111
- 3, 28, :_reduce_8,
112
- 3, 28, :_reduce_9,
113
- 4, 28, :_reduce_10,
114
- 1, 28, :_reduce_11,
115
- 1, 28, :_reduce_12,
116
- 1, 28, :_reduce_13,
117
- 1, 28, :_reduce_14,
118
- 3, 30, :_reduce_15,
119
- 6, 30, :_reduce_16,
120
- 5, 30, :_reduce_17,
121
- 5, 30, :_reduce_18,
111
+ 3, 27, :_reduce_4,
112
+ 1, 28, :_reduce_5,
113
+ 2, 29, :_reduce_6,
114
+ 1, 29, :_reduce_7,
115
+ 2, 30, :_reduce_8,
116
+ 1, 30, :_reduce_none,
117
+ 1, 31, :_reduce_none,
118
+ 3, 31, :_reduce_11,
119
+ 3, 31, :_reduce_12,
120
+ 4, 31, :_reduce_13,
121
+ 1, 31, :_reduce_14,
122
+ 1, 31, :_reduce_15,
123
+ 1, 31, :_reduce_16,
124
+ 1, 31, :_reduce_17,
125
+ 3, 33, :_reduce_18,
126
+ 6, 33, :_reduce_19,
127
+ 5, 33, :_reduce_20,
128
+ 5, 33, :_reduce_21,
129
+ 1, 35, :_reduce_none,
130
+ 1, 35, :_reduce_none,
122
131
  1, 32, :_reduce_none,
123
132
  1, 32, :_reduce_none,
124
- 1, 29, :_reduce_none,
125
- 1, 29, :_reduce_none,
126
- 1, 29, :_reduce_none,
127
- 5, 29, :_reduce_24,
128
- 3, 29, :_reduce_25,
129
- 2, 31, :_reduce_26,
130
- 2, 31, :_reduce_27,
131
- 1, 31, :_reduce_none,
132
- 1, 31, :_reduce_none,
133
- 4, 33, :_reduce_30,
134
- 4, 33, :_reduce_31,
135
- 4, 33, :_reduce_32,
136
- 3, 33, :_reduce_33,
137
- 1, 34, :_reduce_34,
138
- 1, 34, :_reduce_35,
139
- 1, 34, :_reduce_36 ]
140
-
141
- racc_reduce_n = 37
142
-
143
- racc_shift_n = 68
133
+ 1, 32, :_reduce_none,
134
+ 2, 32, :_reduce_27,
135
+ 2, 32, :_reduce_28,
136
+ 5, 32, :_reduce_29,
137
+ 3, 32, :_reduce_30,
138
+ 2, 34, :_reduce_31,
139
+ 1, 34, :_reduce_none,
140
+ 4, 36, :_reduce_33,
141
+ 4, 36, :_reduce_34,
142
+ 4, 36, :_reduce_35,
143
+ 3, 36, :_reduce_36,
144
+ 1, 37, :_reduce_37,
145
+ 1, 37, :_reduce_38,
146
+ 1, 37, :_reduce_39 ]
147
+
148
+ racc_reduce_n = 40
149
+
150
+ racc_shift_n = 72
144
151
 
145
152
  racc_token_table = {
146
153
  false => 0,
@@ -217,7 +224,10 @@ Racc_token_to_s_table = [
217
224
  "EXTENDED",
218
225
  "$start",
219
226
  "expression",
220
- "branch",
227
+ "alternation",
228
+ "subexpression",
229
+ "expression_ary",
230
+ "quantified_atom",
221
231
  "atom",
222
232
  "quantifier",
223
233
  "group",
@@ -233,163 +243,178 @@ Racc_debug_parser = false
233
243
  # reduce 0 omitted
234
244
 
235
245
  def _reduce_1(val, _values, result)
236
- result = Expression.new(Alternation.reduce(val[0], val[2]))
246
+ result = Expression.new(val[0])
237
247
  result
238
248
  end
239
249
 
240
- def _reduce_2(val, _values, result)
241
- result = Expression.reduce(val[0])
242
- result
243
- end
250
+ # reduce 2 omitted
244
251
 
245
252
  def _reduce_3(val, _values, result)
246
- result = Expression.reduce(val[0], val[1].dup(:quantifier => val[2]))
253
+ result = val[0] + [val[2]]
247
254
  result
248
255
  end
249
256
 
250
257
  def _reduce_4(val, _values, result)
251
- result = Expression.reduce(val[0], val[1])
258
+ result = Alternation.new(val[0], val[2])
252
259
  result
253
260
  end
254
261
 
255
262
  def _reduce_5(val, _values, result)
256
- result = val[0].dup(:quantifier => val[1])
263
+ result = Expression.new(val[0])
257
264
  result
258
265
  end
259
266
 
260
- # reduce 6 omitted
267
+ def _reduce_6(val, _values, result)
268
+ result = val[0] + [val[1]]
269
+ result
270
+ end
261
271
 
262
- # reduce 7 omitted
272
+ def _reduce_7(val, _values, result)
273
+ result = [val[0]]
274
+ result
275
+ end
263
276
 
264
277
  def _reduce_8(val, _values, result)
278
+ result = val[0].dup(:quantifier => val[1])
279
+ result
280
+ end
281
+
282
+ # reduce 9 omitted
283
+
284
+ # reduce 10 omitted
285
+
286
+ def _reduce_11(val, _values, result)
265
287
  result = CharacterClass.new(val[1])
266
288
  result
267
289
  end
268
290
 
269
- def _reduce_9(val, _values, result)
291
+ def _reduce_12(val, _values, result)
270
292
  result = CharacterClass.new(val[1])
271
293
  result
272
294
  end
273
295
 
274
- def _reduce_10(val, _values, result)
296
+ def _reduce_13(val, _values, result)
275
297
  result = CharacterClass.new(val[2], :negate => true)
276
298
  result
277
299
  end
278
300
 
279
- def _reduce_11(val, _values, result)
301
+ def _reduce_14(val, _values, result)
280
302
  result = CharacterClass.new(val[0])
281
303
  result
282
304
  end
283
305
 
284
- def _reduce_12(val, _values, result)
306
+ def _reduce_15(val, _values, result)
285
307
  result = CharacterClass.new('.')
286
308
  result
287
309
  end
288
310
 
289
- def _reduce_13(val, _values, result)
311
+ def _reduce_16(val, _values, result)
290
312
  result = Anchor.new(val[0])
291
313
  result
292
314
  end
293
315
 
294
- def _reduce_14(val, _values, result)
316
+ def _reduce_17(val, _values, result)
295
317
  result = Character.new(val[0])
296
318
  result
297
319
  end
298
320
 
299
- def _reduce_15(val, _values, result)
321
+ def _reduce_18(val, _values, result)
300
322
  result = Group.new(val[1], :index => @capture_index_stack.pop)
301
323
 
302
324
  result
303
325
  end
304
326
 
305
- def _reduce_16(val, _values, result)
327
+ def _reduce_19(val, _values, result)
306
328
  result = Group.new(val[4], val[2].merge(:capture => false))
307
329
  @options_stack.pop
308
330
 
309
331
  result
310
332
  end
311
333
 
312
- def _reduce_17(val, _values, result)
334
+ def _reduce_20(val, _values, result)
313
335
  result = Group.new(val[3], :capture => false);
314
336
 
315
337
  result
316
338
  end
317
339
 
318
- def _reduce_18(val, _values, result)
340
+ def _reduce_21(val, _values, result)
319
341
  result = Group.new(val[3], :name => val[2], :index => @capture_index_stack.pop);
320
342
 
321
343
  result
322
344
  end
323
345
 
324
- # reduce 19 omitted
346
+ # reduce 22 omitted
325
347
 
326
- # reduce 20 omitted
348
+ # reduce 23 omitted
327
349
 
328
- # reduce 21 omitted
350
+ # reduce 24 omitted
329
351
 
330
- # reduce 22 omitted
352
+ # reduce 25 omitted
331
353
 
332
- # reduce 23 omitted
354
+ # reduce 26 omitted
333
355
 
334
- def _reduce_24(val, _values, result)
356
+ def _reduce_27(val, _values, result)
335
357
  result = val.join
336
358
  result
337
359
  end
338
360
 
339
- def _reduce_25(val, _values, result)
361
+ def _reduce_28(val, _values, result)
340
362
  result = val.join
341
363
  result
342
364
  end
343
365
 
344
- def _reduce_26(val, _values, result)
366
+ def _reduce_29(val, _values, result)
345
367
  result = val.join
346
368
  result
347
369
  end
348
370
 
349
- def _reduce_27(val, _values, result)
371
+ def _reduce_30(val, _values, result)
350
372
  result = val.join
351
373
  result
352
374
  end
353
375
 
354
- # reduce 28 omitted
376
+ def _reduce_31(val, _values, result)
377
+ result = val.join
378
+ result
379
+ end
355
380
 
356
- # reduce 29 omitted
381
+ # reduce 32 omitted
357
382
 
358
- def _reduce_30(val, _values, result)
383
+ def _reduce_33(val, _values, result)
359
384
  @options_stack << result = { val[1] => false, val[2] => false, val[3] => false }
360
385
 
361
386
  result
362
387
  end
363
388
 
364
- def _reduce_31(val, _values, result)
389
+ def _reduce_34(val, _values, result)
365
390
  @options_stack << result = { val[0] => true, val[2] => false, val[3] => false }
366
391
 
367
392
  result
368
393
  end
369
394
 
370
- def _reduce_32(val, _values, result)
395
+ def _reduce_35(val, _values, result)
371
396
  @options_stack << result = { val[0] => true, val[1] => true, val[3] => false }
372
397
 
373
398
  result
374
399
  end
375
400
 
376
- def _reduce_33(val, _values, result)
401
+ def _reduce_36(val, _values, result)
377
402
  @options_stack << result = { val[0] => true, val[1] => true, val[2] => true }
378
403
 
379
404
  result
380
405
  end
381
406
 
382
- def _reduce_34(val, _values, result)
407
+ def _reduce_37(val, _values, result)
383
408
  result = :multiline
384
409
  result
385
410
  end
386
411
 
387
- def _reduce_35(val, _values, result)
412
+ def _reduce_38(val, _values, result)
388
413
  result = :ignorecase
389
414
  result
390
415
  end
391
416
 
392
- def _reduce_36(val, _values, result)
417
+ def _reduce_39(val, _values, result)
393
418
  result = :extended
394
419
  result
395
420
  end
@@ -399,7 +424,7 @@ def _reduce_none(val, _values, result)
399
424
  end
400
425
 
401
426
  end # class Parser
402
- end # module Regin
427
+ end # module Regin
403
428
 
404
429
  require 'regin/tokenizer'
405
430
 
@@ -1,11 +1,12 @@
1
1
  #--
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by rex 1.0.5.beta1
3
+ # This file is automatically generated by rex 1.0.4
4
4
  # from lexical definition file "lib/regin/tokenizer.rex".
5
5
  #++
6
6
 
7
7
  require 'racc/parser'
8
- class Regin::Parser < Racc::Parser
8
+ module Regin
9
+ class Parser < Racc::Parser
9
10
  require 'strscan'
10
11
 
11
12
  class ScanError < StandardError ; end
@@ -20,7 +21,7 @@ class Regin::Parser < Racc::Parser
20
21
  @state = nil
21
22
  end
22
23
 
23
- def action
24
+ def action(&block)
24
25
  yield
25
26
  end
26
27
 
@@ -28,7 +29,6 @@ class Regin::Parser < Racc::Parser
28
29
  scan_setup(str)
29
30
  do_parse
30
31
  end
31
- alias :scan :scan_str
32
32
 
33
33
  def load_file( filename )
34
34
  @filename = filename
@@ -137,7 +137,7 @@ class Regin::Parser < Racc::Parser
137
137
  action { @state = nil; [:RBRACK, text] }
138
138
 
139
139
  when (text = @ss.scan(/\^/))
140
- action { [:NEGATE, text] }
140
+ action { [@ss.string[@ss.pos-2, 1] == '[' ? :NEGATE : :CHAR, text] }
141
141
 
142
142
  when (text = @ss.scan(/:(alnum|alpha|ascii|blank|cntrl|digit|graph|lower|print|punct|space|upper|word|xdigit):/))
143
143
  action { [:CTYPE, text] }
@@ -211,3 +211,4 @@ class Regin::Parser < Racc::Parser
211
211
  end # def next_token
212
212
 
213
213
  end # class
214
+ end # module
@@ -1,3 +1,3 @@
1
1
  module Regin
2
- Version = '0.2.0'
2
+ Version = '0.3.4'
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Rack::Mount
2
- Version = '0.6.4'
2
+ Version = '0.6.7'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-mount
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 6
10
- version: 0.6.6
9
+ - 7
10
+ version: 0.6.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Peek
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-21 00:00:00 -05:00
18
+ date: 2010-07-12 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency