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 +4 -4
- data/README.md +5 -1
- data/lib/regexp_parser/syntax.rb +3 -0
- data/lib/regexp_parser/syntax/ruby/2.1.6.rb +13 -0
- data/lib/regexp_parser/syntax/ruby/2.1.rb +2 -2
- data/lib/regexp_parser/syntax/ruby/2.2.1.rb +13 -0
- data/lib/regexp_parser/syntax/ruby/2.2.2.rb +13 -0
- data/lib/regexp_parser/syntax/ruby/2.2.rb +2 -2
- data/lib/regexp_parser/version.rb +1 -1
- data/test/syntax/ruby/test_files.rb +45 -15
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccb0d0c3dacb9f2285a8c2458dd9e8a207a4c836
|
4
|
+
data.tar.gz: 27f379340236393b559aa622bd2763d3d27ec3a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/regexp_parser/syntax.rb
CHANGED
@@ -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
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require File.expand_path('../2.1.
|
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::
|
6
|
+
class V21 < Regexp::Syntax::Ruby::V216; end
|
7
7
|
end
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require File.expand_path('../2.2.
|
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::
|
6
|
+
class V22 < Regexp::Syntax::Ruby::V222; end
|
7
7
|
end
|
8
8
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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.
|
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-
|
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.
|
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
|