Whitelist regexp_parser warning and bump regexp_parser to 0.4.9
* Add regexp_xgrapheme_type
This commit is contained in:
parent
766edf714f
commit
b95aa9c05a
9 changed files with 22 additions and 25 deletions
|
@ -15,7 +15,7 @@ PATH
|
|||
parallel (~> 1.3)
|
||||
parser (>= 2.3.1.4, < 2.5)
|
||||
procto (~> 0.0.2)
|
||||
regexp_parser (~> 0.4.4)
|
||||
regexp_parser (~> 0.4.9)
|
||||
unparser (~> 0.2.5)
|
||||
mutant-rspec (0.8.14)
|
||||
mutant (~> 0.8.14)
|
||||
|
@ -92,7 +92,7 @@ GEM
|
|||
equalizer (~> 0.0.9)
|
||||
ice_nine (~> 0.11.0)
|
||||
procto (~> 0.0.2)
|
||||
parallel (1.11.2)
|
||||
parallel (1.12.1)
|
||||
parser (2.4.0.0)
|
||||
ast (~> 2.2)
|
||||
path_expander (1.0.2)
|
||||
|
@ -105,7 +105,7 @@ GEM
|
|||
codeclimate-engine-rb (~> 0.4.0)
|
||||
parser (>= 2.4.0.0, < 2.5)
|
||||
rainbow (~> 2.0)
|
||||
regexp_parser (0.4.4)
|
||||
regexp_parser (0.4.9)
|
||||
rspec (3.5.0)
|
||||
rspec-core (~> 3.5.0)
|
||||
rspec-expectations (~> 3.5.0)
|
||||
|
@ -166,4 +166,4 @@ DEPENDENCIES
|
|||
mutant!
|
||||
|
||||
BUNDLED WITH
|
||||
1.15.1
|
||||
1.15.4
|
||||
|
|
|
@ -75,6 +75,7 @@ module Mutant
|
|||
[:regexp_digit_type, [:type, :digit, '\d'], ::Regexp::Expression::CharacterType::Digit],
|
||||
[:regexp_space_type, [:type, :space, '\s'], ::Regexp::Expression::CharacterType::Space],
|
||||
[:regexp_word_type, [:type, :word, '\w'], ::Regexp::Expression::CharacterType::Word],
|
||||
[:regexp_xgrapheme_type, [:type, :xgrapheme, '\X'], ::Regexp::Expression::CharacterType::ExtendedGrapheme],
|
||||
[:regexp_hex_type, [:type, :hex, '\h'], ::Regexp::Expression::CharacterType::Hex],
|
||||
[:regexp_nonhex_type, [:type, :nonhex, '\H'], ::Regexp::Expression::CharacterType::NonHex],
|
||||
[:regexp_nondigit_type, [:type, :nondigit, '\D'], ::Regexp::Expression::CharacterType::NonDigit],
|
||||
|
|
|
@ -125,6 +125,7 @@ module Mutant
|
|||
regexp_whitespace_free_space
|
||||
regexp_word_boundary_anchor
|
||||
regexp_word_type
|
||||
regexp_xgrapheme_type
|
||||
regexp_zero_or_more_escape
|
||||
regexp_zero_or_one_escape
|
||||
])
|
||||
|
|
|
@ -54,6 +54,7 @@ module Mutant
|
|||
regexp_space_type
|
||||
regexp_word_boundary_anchor
|
||||
regexp_word_type
|
||||
regexp_xgrapheme_type
|
||||
]
|
||||
|
||||
# These nodes still need a dedicated mutator,
|
||||
|
|
|
@ -9,7 +9,8 @@ module Mutant
|
|||
regexp_hex_type: :regexp_nonhex_type,
|
||||
regexp_space_type: :regexp_nonspace_type,
|
||||
regexp_word_boundary_anchor: :regexp_nonword_boundary_anchor,
|
||||
regexp_word_type: :regexp_nonword_type
|
||||
regexp_word_type: :regexp_nonword_type,
|
||||
regexp_xgrapheme_type: :regexp_space_type
|
||||
}
|
||||
|
||||
MAP = IceNine.deep_freeze(map.merge(map.invert))
|
||||
|
|
|
@ -3,7 +3,8 @@ mutations = {
|
|||
[:regexp_hex_type, '/\h/'] => [:regexp_nonhex_type, '/\H/'],
|
||||
[:regexp_space_type, '/\s/'] => [:regexp_nonspace_type, '/\S/'],
|
||||
[:regexp_word_boundary_anchor, '/\b/'] => [:regexp_nonword_boundary_anchor, '/\B/'],
|
||||
[:regexp_word_type, '/\w/'] => [:regexp_nonword_type, '/\W/']
|
||||
[:regexp_word_type, '/\w/'] => [:regexp_nonword_type, '/\W/'],
|
||||
[:regexp_xgrapheme_type, '/\X/'] => [:regexp_space_type, '/\s/']
|
||||
}
|
||||
|
||||
mutations = mutations.merge(mutations.invert)
|
||||
|
|
|
@ -35,7 +35,7 @@ Gem::Specification.new do |gem|
|
|||
gem.add_runtime_dependency('equalizer', '~> 0.0.9')
|
||||
gem.add_runtime_dependency('anima', '~> 0.3.0')
|
||||
gem.add_runtime_dependency('concord', '~> 0.1.5')
|
||||
gem.add_runtime_dependency('regexp_parser', '~> 0.4.4')
|
||||
gem.add_runtime_dependency('regexp_parser', '~> 0.4.9')
|
||||
|
||||
gem.add_development_dependency('devtools', '~> 0.1.12')
|
||||
gem.add_development_dependency('bundler', '~> 1.10')
|
||||
|
|
|
@ -3,3 +3,5 @@
|
|||
- 'lib/parallel.rb:227: warning: shadowing outer local variable - args'
|
||||
- 'lib/parser/lexer.rb:10922: warning: assigned but unused variable - testEof'
|
||||
- 'lib/regexp_parser/scanner.rb:1675: warning: assigned but unused variable - testEof'
|
||||
- 'lib/regexp_parser/scanner.rb:1692: warning: assigned but unused variable - testEof'
|
||||
- 'lib/regexp_parser/scanner.rb:1689: warning: assigned but unused variable - testEof'
|
||||
|
|
|
@ -227,12 +227,7 @@ RegexpSpec.expect_mapping(/(?x-: # comment
|
|||
)/, :regexp_comment_free_space) do
|
||||
s(:regexp_root_expression,
|
||||
s(:regexp_options_group, {
|
||||
m: false,
|
||||
i: false,
|
||||
x: true,
|
||||
d: false,
|
||||
a: false,
|
||||
u: false
|
||||
x: true
|
||||
},
|
||||
s(:regexp_whitespace_free_space, ' '),
|
||||
s(:regexp_comment_free_space, "# comment\n")))
|
||||
|
@ -354,6 +349,11 @@ RegexpSpec.expect_mapping(/\H/, :regexp_hex_type) do
|
|||
s(:regexp_nonhex_type))
|
||||
end
|
||||
|
||||
RegexpSpec.expect_mapping(/\X/, :regexp_xgrapheme_type) do
|
||||
s(:regexp_root_expression,
|
||||
s(:regexp_xgrapheme_type))
|
||||
end
|
||||
|
||||
RegexpSpec.expect_mapping(/\}/, :regexp_interval_close_escape) do
|
||||
s(:regexp_root_expression,
|
||||
s(:regexp_interval_close_escape))
|
||||
|
@ -480,12 +480,7 @@ RegexpSpec.expect_mapping(/(?i-:a)+/, :regexp_options_group) do
|
|||
s(:regexp_greedy_one_or_more, 1, -1,
|
||||
s(:regexp_options_group,
|
||||
{
|
||||
m: false,
|
||||
i: true,
|
||||
x: false,
|
||||
d: false,
|
||||
a: false,
|
||||
u: false
|
||||
i: true
|
||||
},
|
||||
s(:regexp_literal_literal, 'a'))))
|
||||
end
|
||||
|
@ -494,12 +489,7 @@ RegexpSpec.expect_mapping(/(?x-: #{"\n"} )/, :regexp_whitespace_free_space) do
|
|||
s(:regexp_root_expression,
|
||||
s(:regexp_options_group,
|
||||
{
|
||||
m: false,
|
||||
i: false,
|
||||
x: true,
|
||||
d: false,
|
||||
a: false,
|
||||
u: false
|
||||
x: true
|
||||
},
|
||||
s(:regexp_whitespace_free_space, " \n ")))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue