Skip to content

Commit

Permalink
Remove some unused token declarations from Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jaynetics committed Oct 11, 2018
1 parent 909c856 commit 2bec44c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/regexp_parser/syntax/tokens/character_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module CharacterSet
OpenClose = [:open, :close]

Basic = [:negate, :range]
Extended = Basic + [:intersection, :backspace]
Extended = Basic + [:intersection]

All = Basic + Extended
Type = :set
Expand Down
8 changes: 2 additions & 6 deletions lib/regexp_parser/syntax/tokens/escape.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
module Regexp::Syntax
module Token

module Escape
Basic = [:backslash, :literal]

Backreference = [:digit]
Basic = [:backslash, :literal]

Control = [:control, :meta_sequence]

Expand All @@ -24,11 +21,10 @@ module Escape

Octal = [:octal]

All = Basic + Backreference + ASCII + Meta
All = Basic + ASCII + Meta
Type = :escape
end

Map[Escape::Type] = Escape::All

end
end
3 changes: 1 addition & 2 deletions lib/regexp_parser/syntax/versions/1.8.6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def initialize
implements :backref, [:number]
implements :posixclass, PosixClass::Standard
implements :escape,
Escape::Basic + Escape::Backreference +
Escape::ASCII + Escape::Meta + Escape::Control
Escape::Basic + Escape::ASCII + Escape::Meta + Escape::Control

implements :group, Group::All

Expand Down
3 changes: 1 addition & 2 deletions test/syntax/versions/test_1.9.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def setup
tests = {
implements: {
escape: [
Escape::Backreference + Escape::ASCII + Escape::Meta + Escape::Unicode +
Escape::Hex + Escape::Octal
Escape::ASCII + Escape::Meta + Escape::Unicode + Escape::Hex + Escape::Octal
].flatten,

type: [
Expand Down

0 comments on commit 2bec44c

Please sign in to comment.