regexp_parser 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +9 -0
- data/README.md +10 -4
- data/lib/regexp_parser/parser.rb +11 -5
- data/lib/regexp_parser/scanner.rb +1046 -1049
- data/lib/regexp_parser/scanner/scanner.rl +1 -1
- data/lib/regexp_parser/syntax/ruby/1.9.1.rb +1 -1
- data/lib/regexp_parser/syntax/tokens/escape.rb +2 -0
- data/lib/regexp_parser/version.rb +1 -1
- data/test/parser/test_escapes.rb +3 -0
- data/test/parser/test_quantifiers.rb +2 -0
- data/test/scanner/test_groups.rb +1 -0
- data/test/syntax/ruby/test_1.9.1.rb +1 -1
- metadata +2 -2
data/test/parser/test_escapes.rb
CHANGED
@@ -25,6 +25,9 @@ class TestParserEscapes < Test::Unit::TestCase
|
|
25
25
|
/a\)c/ => [1, :escape, :group_close, EscapeSequence::Literal],
|
26
26
|
/a\{c/ => [1, :escape, :interval_open, EscapeSequence::Literal],
|
27
27
|
/a\}c/ => [1, :escape, :interval_close, EscapeSequence::Literal],
|
28
|
+
|
29
|
+
# unicode escapes
|
30
|
+
/a\u{9879}/ => [1, :escape, :codepoint_list, EscapeSequence::Literal],
|
28
31
|
}
|
29
32
|
|
30
33
|
count = 0
|
@@ -150,6 +150,7 @@ class TestRegexpParserQuantifiers < Test::Unit::TestCase
|
|
150
150
|
|
151
151
|
assert_equal( true, t.expressions.first.quantified? )
|
152
152
|
assert_equal( :interval, t.expressions.first.quantifier.token )
|
153
|
+
assert_equal( '{2,}?', t.expressions.first.quantifier.text )
|
153
154
|
assert_equal( 2, t.expressions.first.quantifier.min)
|
154
155
|
assert_equal( -1, t.expressions.first.quantifier.max)
|
155
156
|
assert_equal( :reluctant, t.expressions.first.quantifier.mode )
|
@@ -161,6 +162,7 @@ class TestRegexpParserQuantifiers < Test::Unit::TestCase
|
|
161
162
|
|
162
163
|
assert_equal( true, t.expressions.first.quantified? )
|
163
164
|
assert_equal( :interval, t.expressions.first.quantifier.token )
|
165
|
+
assert_equal( '{3,}+', t.expressions.first.quantifier.text )
|
164
166
|
assert_equal( 3, t.expressions.first.quantifier.min)
|
165
167
|
assert_equal( -1, t.expressions.first.quantifier.max)
|
166
168
|
assert_equal( :possessive, t.expressions.first.quantifier.mode )
|
data/test/scanner/test_groups.rb
CHANGED
@@ -10,7 +10,7 @@ class TestSyntaxRuby_V191 < Test::Unit::TestCase
|
|
10
10
|
tests = {
|
11
11
|
:implements => {
|
12
12
|
:escape => [
|
13
|
-
Escape::Backreference + Escape::ASCII + Escape::Meta
|
13
|
+
Escape::Backreference + Escape::ASCII + Escape::Meta + Escape::Unicode
|
14
14
|
].flatten,
|
15
15
|
|
16
16
|
:quantifier => [
|
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ammar Ali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
|
14
14
|
email:
|