regexp_parser 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 231a27b00daf24a41710b45ef92fef5b6963dc5a
4
- data.tar.gz: 1cd1f75da74654cd20a0ac7716aed8519490fef5
3
+ metadata.gz: ccb0d0c3dacb9f2285a8c2458dd9e8a207a4c836
4
+ data.tar.gz: 27f379340236393b559aa622bd2763d3d27ec3a1
5
5
  SHA512:
6
- metadata.gz: 620846b89adb5b8d27efe722af58951951ce0e7362f646fcc397c94f5597dc999d79851a507d13338ca7f59b67a25539a205878209f7787f6d4053ba95b2555c
7
- data.tar.gz: 2f2400eede6011229f6690c8230ae1c6b3abdc2e83380cf0e7b8b6e1dd72c2c7035e82f87f808f64e0f47442df961ba13dae04164c35c776f41cf92aefa2f515
6
+ metadata.gz: 29fe46ace91ba3b6b106423fa212707e98ccc7f1559094f14bc9a017f4ec28e2ab9deae1e000a71c8329d65791445e73f004eda77cbd7293865ae518df1b894d
7
+ data.tar.gz: 0f6f3530c2de9e60782ed914deb594137ce37735b21a50f305f1548df06896d6618b95cd69e25de9dcc0a58b03d8a08306355e67c47478e4ef09cb278caf815c
data/README.md CHANGED
@@ -9,7 +9,7 @@ A ruby gem for tokenizing, parsing, and transforming regular expressions.
9
9
  * A lexer that produces a "stream" of token objects.
10
10
  * A parser that produces a "tree" of Expression objects (OO API)
11
11
  * Runs on ruby 1.8, 1.9, 2.x, and jruby (1.9 mode) runtimes.
12
- * Recognizes ruby 1.8, 1.9, and 2.x regular expressions [See Scanner Syntax](#scanner-syntax)
12
+ * Recognizes ruby 1.8, 1.9, and 2.x regular expressions [See Supported Syntax](#supported-syntax)
13
13
 
14
14
 
15
15
  _For an example of regexp_parser in use, see the [meta_re project](https://github.com/ammar/meta_re)_
@@ -358,6 +358,10 @@ _Note that not all of these are available in all versions of Ruby_
358
358
 
359
359
 
360
360
  <br/>
361
+ ##### Missing Features
362
+
363
+ - Unicode blocks, e.g. \p{InArrows}, \p{InArmenian}. _(h/t @gjtorikian for pointing it out)_
364
+
361
365
  ##### Inapplicable Features
362
366
 
363
367
  Some modifiers, like `o` and `s`, apply to the **Regexp** object itself and do not
@@ -66,12 +66,15 @@ module Regexp::Syntax
66
66
  when 'ruby/2.1.3'; syntax = Regexp::Syntax::Ruby::V213.new
67
67
  when 'ruby/2.1.4'; syntax = Regexp::Syntax::Ruby::V214.new
68
68
  when 'ruby/2.1.5'; syntax = Regexp::Syntax::Ruby::V215.new
69
+ when 'ruby/2.1.6'; syntax = Regexp::Syntax::Ruby::V216.new
69
70
 
70
71
  # aliases for the latest 2.1 implementations
71
72
  when 'ruby/2.1'; syntax = Regexp::Syntax::Ruby::V21.new
72
73
 
73
74
  # Ruby 2.2.x
74
75
  when 'ruby/2.2.0'; syntax = Regexp::Syntax::Ruby::V220.new
76
+ when 'ruby/2.2.1'; syntax = Regexp::Syntax::Ruby::V221.new
77
+ when 'ruby/2.2.2'; syntax = Regexp::Syntax::Ruby::V222.new
75
78
 
76
79
  # aliases for the latest 2.2 implementations
77
80
  when 'ruby/2.2'; syntax = Regexp::Syntax::Ruby::V22.new
@@ -0,0 +1,13 @@
1
+ require File.expand_path('../2.1.5', __FILE__)
2
+
3
+ module Regexp::Syntax
4
+ module Ruby
5
+
6
+ class V216 < Regexp::Syntax::Ruby::V215
7
+ def initialize
8
+ super
9
+ end
10
+ end
11
+
12
+ end
13
+ end
@@ -1,8 +1,8 @@
1
- require File.expand_path('../2.1.5', __FILE__)
1
+ require File.expand_path('../2.1.6', __FILE__)
2
2
 
3
3
  module Regexp::Syntax
4
4
  module Ruby
5
5
  # uses the latest 2.1 release
6
- class V21 < Regexp::Syntax::Ruby::V215; end
6
+ class V21 < Regexp::Syntax::Ruby::V216; end
7
7
  end
8
8
  end
@@ -0,0 +1,13 @@
1
+ require File.expand_path('../2.2.0', __FILE__)
2
+
3
+ module Regexp::Syntax
4
+ module Ruby
5
+
6
+ class V221 < Regexp::Syntax::Ruby::V220
7
+ def initialize
8
+ super
9
+ end
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ require File.expand_path('../2.2.1', __FILE__)
2
+
3
+ module Regexp::Syntax
4
+ module Ruby
5
+
6
+ class V222 < Regexp::Syntax::Ruby::V221
7
+ def initialize
8
+ super
9
+ end
10
+ end
11
+
12
+ end
13
+ end
@@ -1,8 +1,8 @@
1
- require File.expand_path('../2.2.0', __FILE__)
1
+ require File.expand_path('../2.2.2', __FILE__)
2
2
 
3
3
  module Regexp::Syntax
4
4
  module Ruby
5
5
  # uses the latest 2.2 release
6
- class V22 < Regexp::Syntax::Ruby::V220; end
6
+ class V22 < Regexp::Syntax::Ruby::V222; end
7
7
  end
8
8
  end
@@ -1,5 +1,5 @@
1
1
  class Regexp
2
2
  module Parser
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -6,19 +6,19 @@ class TestSyntaxFiles < Test::Unit::TestCase
6
6
  def test_syntax_file_1_8_6
7
7
  syntax = Regexp::Syntax.new 'ruby/1.8.6'
8
8
 
9
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V186) )
9
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V186)
10
10
  end
11
11
 
12
12
  def test_syntax_file_1_8_7
13
13
  syntax = Regexp::Syntax.new 'ruby/1.8.7'
14
14
 
15
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V187) )
15
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V187)
16
16
  end
17
17
 
18
18
  def test_syntax_file_1_8_alias
19
19
  syntax = Regexp::Syntax.new 'ruby/1.8'
20
20
 
21
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V187) )
21
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V187)
22
22
  end
23
23
 
24
24
 
@@ -26,25 +26,25 @@ class TestSyntaxFiles < Test::Unit::TestCase
26
26
  def test_syntax_file_1_9_1
27
27
  syntax = Regexp::Syntax.new 'ruby/1.9.1'
28
28
 
29
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V191) )
29
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V191)
30
30
  end
31
31
 
32
32
  def test_syntax_file_1_9_2
33
33
  syntax = Regexp::Syntax.new 'ruby/1.9.2'
34
34
 
35
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V192) )
35
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V192)
36
36
  end
37
37
 
38
38
  def test_syntax_file_1_9_3
39
39
  syntax = Regexp::Syntax.new 'ruby/1.9.3'
40
40
 
41
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V193) )
41
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V193)
42
42
  end
43
43
 
44
44
  def test_syntax_file_1_9_alias
45
45
  syntax = Regexp::Syntax.new 'ruby/1.9'
46
46
 
47
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V193) )
47
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V193)
48
48
  end
49
49
 
50
50
 
@@ -52,13 +52,13 @@ class TestSyntaxFiles < Test::Unit::TestCase
52
52
  def test_syntax_file_2_0_0
53
53
  syntax = Regexp::Syntax.new 'ruby/2.0.0'
54
54
 
55
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V19) )
55
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V19)
56
56
  end
57
57
 
58
58
  def test_syntax_file_2_0_alias
59
59
  syntax = Regexp::Syntax.new 'ruby/2.0'
60
60
 
61
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V200) )
61
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V200)
62
62
  end
63
63
 
64
64
 
@@ -66,25 +66,43 @@ class TestSyntaxFiles < Test::Unit::TestCase
66
66
  def test_syntax_file_2_1_0
67
67
  syntax = Regexp::Syntax.new 'ruby/2.1.0'
68
68
 
69
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V20) )
69
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V20)
70
70
  end
71
71
 
72
72
  def test_syntax_file_2_1_2
73
73
  syntax = Regexp::Syntax.new 'ruby/2.1.2'
74
74
 
75
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V210) )
75
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V210)
76
76
  end
77
77
 
78
78
  def test_syntax_file_2_1_3
79
79
  syntax = Regexp::Syntax.new 'ruby/2.1.3'
80
80
 
81
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V212) )
81
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V212)
82
+ end
83
+
84
+ def test_syntax_file_2_1_4
85
+ syntax = Regexp::Syntax.new 'ruby/2.1.4'
86
+
87
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V213)
88
+ end
89
+
90
+ def test_syntax_file_2_1_5
91
+ syntax = Regexp::Syntax.new 'ruby/2.1.5'
92
+
93
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V214)
94
+ end
95
+
96
+ def test_syntax_file_2_1_6
97
+ syntax = Regexp::Syntax.new 'ruby/2.1.6'
98
+
99
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V215)
82
100
  end
83
101
 
84
102
  def test_syntax_file_2_1_alias
85
103
  syntax = Regexp::Syntax.new 'ruby/2.1'
86
104
 
87
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V213) )
105
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V216)
88
106
  end
89
107
 
90
108
 
@@ -92,13 +110,25 @@ class TestSyntaxFiles < Test::Unit::TestCase
92
110
  def test_syntax_file_2_2_0
93
111
  syntax = Regexp::Syntax.new 'ruby/2.2.0'
94
112
 
95
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V21) )
113
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V21)
114
+ end
115
+
116
+ def test_syntax_file_2_2_1
117
+ syntax = Regexp::Syntax.new 'ruby/2.2.1'
118
+
119
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V220)
120
+ end
121
+
122
+ def test_syntax_file_2_2_2
123
+ syntax = Regexp::Syntax.new 'ruby/2.2.2'
124
+
125
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V221)
96
126
  end
97
127
 
98
128
  def test_syntax_file_2_2_alias
99
129
  syntax = Regexp::Syntax.new 'ruby/2.2'
100
130
 
101
- assert_equal( true, syntax.kind_of?(Regexp::Syntax::Ruby::V220) )
131
+ assert syntax.kind_of?(Regexp::Syntax::Ruby::V222)
102
132
  end
103
133
 
104
134
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regexp_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ammar Ali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-05 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
14
14
  email:
@@ -63,8 +63,11 @@ files:
63
63
  - lib/regexp_parser/syntax/ruby/2.1.3.rb
64
64
  - lib/regexp_parser/syntax/ruby/2.1.4.rb
65
65
  - lib/regexp_parser/syntax/ruby/2.1.5.rb
66
+ - lib/regexp_parser/syntax/ruby/2.1.6.rb
66
67
  - lib/regexp_parser/syntax/ruby/2.1.rb
67
68
  - lib/regexp_parser/syntax/ruby/2.2.0.rb
69
+ - lib/regexp_parser/syntax/ruby/2.2.1.rb
70
+ - lib/regexp_parser/syntax/ruby/2.2.2.rb
68
71
  - lib/regexp_parser/syntax/ruby/2.2.rb
69
72
  - lib/regexp_parser/syntax/tokens.rb
70
73
  - lib/regexp_parser/syntax/tokens/anchor.rb
@@ -164,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
167
  version: '0'
165
168
  requirements: []
166
169
  rubyforge_project:
167
- rubygems_version: 2.4.4
170
+ rubygems_version: 2.4.5
168
171
  signing_key:
169
172
  specification_version: 4
170
173
  summary: Scanner, lexer, parser for ruby's regular expressions