mutant 0.10.30 → 0.10.31

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
  SHA256:
3
- metadata.gz: 92495691b68b4f556972ce8ec9bc8db2a30acb78980f509b27f2d12d4883b1f6
4
- data.tar.gz: b7e46f8a0e0544243aab53a9f873bc602ec52e83caa9de3e851e4415b8f15899
3
+ metadata.gz: 4ef901ceb41d6239377dac9b9c7c8cc908775e76f12dee66998087f3f6ef70a0
4
+ data.tar.gz: fc6b949b0bb8c8353cdab6186307daf67e5274faded923aaa8941dd0f5219de3
5
5
  SHA512:
6
- metadata.gz: e7e49890adfcebdb4158d0e3d4afdc45589c49f1f66a4ecd700a7003dc3bf73acb967d6a51c1ea3c014edc1367ee1f5c79c4ebce8f5ca8c9dfac7f721649ad26
7
- data.tar.gz: 644ec9e3cb8a5d768b52d709aaf86222fdf588822d139f008aaed3aadd2a9606b0524760e4cbec230d3ba17012374006febd1cbad1eab9839e4166560e3add51
6
+ metadata.gz: c05c611a7cc443e82d278fcaac02f1b43413b30dff81c602d468aea5256cb3389850c414f5415fbd6d7fa67aac035669c325edf3ffccaa915fa70cb03b8dbdc0
7
+ data.tar.gz: e171127271fc59b0d66a9050e9cb9398e5f0caecf13df14289e9acf1f7940cefa9b9760c051655c41090a5cb2235e18465b7dde72b4ed27ac21b80a745850cc0
@@ -11,7 +11,9 @@ module Mutant
11
11
  class Transformer
12
12
  include AbstractType
13
13
 
14
- REGISTRY = Registry.new
14
+ REGISTRY = Registry.new(
15
+ ->(type) { fail "No regexp transformer registered for: #{type}" }
16
+ )
15
17
 
16
18
  # Lookup transformer class for regular expression node type
17
19
  #
@@ -74,6 +74,7 @@ module Mutant
74
74
  [:regexp_katakana_property, [:property, :katakana, '\p{Katakana}'], ::Regexp::Expression::UnicodeProperty::Script],
75
75
  [:regexp_letter_property, [:property, :letter, '\p{L}'], ::Regexp::Expression::UnicodeProperty::Letter::Any],
76
76
  [:regexp_linebreak_type, [:type, :linebreak, '\R'], ::Regexp::Expression::CharacterType::Linebreak],
77
+ [:regexp_latin_property, [:property, :latin, '\p{Latin}'], ::Regexp::Expression::UnicodeProperty::Script],
77
78
  [:regexp_lower_posixclass, [:posixclass, :lower, '[:lower:]'], ::Regexp::Expression::PosixClass],
78
79
  [:regexp_mark_keep, [:keep, :mark, '\K'], ::Regexp::Expression::Keep::Mark],
79
80
  [:regexp_match_start_anchor, [:anchor, :match_start, '\\G'], ::Regexp::Expression::Anchor::MatchStart],
@@ -107,6 +107,7 @@ module Mutant
107
107
  regexp_interval_close_escape
108
108
  regexp_interval_open_escape
109
109
  regexp_katakana_property
110
+ regexp_latin_property
110
111
  regexp_letter_property
111
112
  regexp_linebreak_type
112
113
  regexp_literal_escape
@@ -4,7 +4,7 @@ module Mutant
4
4
  # Generator for mutations
5
5
  class Mutator
6
6
 
7
- REGISTRY = Registry.new
7
+ REGISTRY = Registry.new(->(_) { Node::Generic })
8
8
 
9
9
  include(
10
10
  Adamantium,
@@ -3,13 +3,13 @@
3
3
  module Mutant
4
4
  # Registry for mapping AST types to classes
5
5
  class Registry
6
- include Concord.new(:contents)
6
+ include Concord.new(:contents, :default)
7
7
 
8
8
  # Initialize object
9
9
  #
10
10
  # @return [undefined]
11
- def initialize
12
- super({})
11
+ def initialize(default)
12
+ super({}, default)
13
13
  end
14
14
 
15
15
  # Raised when the type is an invalid type
@@ -34,7 +34,7 @@ module Mutant
34
34
  #
35
35
  # @return [Class<Mutator>]
36
36
  def lookup(type)
37
- contents.fetch(type, Mutator::Node::Generic)
37
+ contents.fetch(type, &default)
38
38
  end
39
39
 
40
40
  end # Registry
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.10.30'
5
+ VERSION = '0.10.31'
6
6
  end # Mutant
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.30
4
+ version: 0.10.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-25 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -364,7 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
364
  - !ruby/object:Gem::Version
365
365
  version: '0'
366
366
  requirements: []
367
- rubygems_version: 3.0.3
367
+ rubygems_version: 3.2.15
368
368
  signing_key:
369
369
  specification_version: 4
370
370
  summary: ''