regexp_parser 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +37 -0
- data/README.md +443 -0
- data/Rakefile +28 -46
- data/VERSION.yml +1 -1
- data/lib/regexp_parser/parser.rb +3 -1
- data/lib/regexp_parser/scanner.rb +29 -34
- data/lib/regexp_parser/scanner/scanner.rl +2 -2
- data/lib/regexp_parser/syntax.rb +13 -3
- data/lib/regexp_parser/syntax/ruby/2.0.0.rb +2 -2
- data/lib/regexp_parser/syntax/ruby/2.0.rb +8 -0
- data/lib/regexp_parser/syntax/ruby/2.1.0.rb +2 -2
- data/lib/regexp_parser/syntax/ruby/2.1.2.rb +13 -0
- data/lib/regexp_parser/syntax/ruby/2.1.3.rb +13 -0
- data/lib/regexp_parser/syntax/ruby/2.1.rb +8 -0
- data/test/parser/test_alternation.rb +11 -0
- data/test/parser/test_sets.rb +7 -0
- data/test/scanner/test_sets.rb +1 -0
- data/test/syntax/ruby/test_2.x.rb +46 -0
- data/test/syntax/ruby/test_all.rb +1 -1
- metadata +15 -14
- data/README.rdoc +0 -307
- data/test/scanner/test_conditionals.rb +0 -31
- data/test/scanner/test_quoting.rb +0 -29
@@ -1,29 +0,0 @@
|
|
1
|
-
require File.expand_path("../../helpers", __FILE__)
|
2
|
-
|
3
|
-
class ScannerQuoting < Test::Unit::TestCase
|
4
|
-
|
5
|
-
tests = {
|
6
|
-
/\Qquoted\Ea/ => [0, :quoted, :literal, '\Qquoted\E', 0, 10],
|
7
|
-
/\Qquoted\Eb/ => [1, :literal, :literal, 'b', 10, 11],
|
8
|
-
/a\Qquoted\Eb\Qquoted\Ec/ => [3, :quoted, :literal, '\Qquoted\E', 12, 22],
|
9
|
-
/a\Qqu\o\t\ed\Eb/ => [1, :quoted, :literal, '\Qqu\o\t\ed\E', 1, 14],
|
10
|
-
}
|
11
|
-
|
12
|
-
count = 0
|
13
|
-
tests.each do |pattern, test|
|
14
|
-
define_method "test_scan_#{test[1]}_#{test[2]}_#{count+=1}" do
|
15
|
-
|
16
|
-
tokens = RS.scan(pattern)
|
17
|
-
token = tokens[test[0]]
|
18
|
-
assert_equal( test[1,5], token )
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
#def test_scanner_quote
|
24
|
-
# tokens = RS.scan('a\QX\Eb\QX\Ec')
|
25
|
-
# puts tokens.inspect
|
26
|
-
# #assert_equal( tokens[0] )
|
27
|
-
#end
|
28
|
-
|
29
|
-
end
|