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 +4 -4
- data/lib/mutant/ast/regexp/transformer.rb +3 -1
- data/lib/mutant/ast/regexp/transformer/direct.rb +1 -0
- data/lib/mutant/ast/types.rb +1 -0
- data/lib/mutant/mutator.rb +1 -1
- data/lib/mutant/registry.rb +4 -4
- data/lib/mutant/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef901ceb41d6239377dac9b9c7c8cc908775e76f12dee66998087f3f6ef70a0
|
4
|
+
data.tar.gz: fc6b949b0bb8c8353cdab6186307daf67e5274faded923aaa8941dd0f5219de3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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],
|
data/lib/mutant/ast/types.rb
CHANGED
data/lib/mutant/mutator.rb
CHANGED
data/lib/mutant/registry.rb
CHANGED
@@ -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,
|
37
|
+
contents.fetch(type, &default)
|
38
38
|
end
|
39
39
|
|
40
40
|
end # Registry
|
data/lib/mutant/version.rb
CHANGED
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.
|
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-
|
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.
|
367
|
+
rubygems_version: 3.2.15
|
368
368
|
signing_key:
|
369
369
|
specification_version: 4
|
370
370
|
summary: ''
|