Class: Spectre::StringParsing::ControlParser

Inherits:
RangeParser
  • Object
show all
Defined in:
lib/spectre/string/primitives.rb

Overview

Matches control characters. Shortcut: control_char.

Instance Attribute Summary

Attributes included from Parser

#node

Instance Method Summary collapse

Methods inherited from RangeParser

#negation, #scan

Methods included from Parser

#backtrack, #create_match, from_POD, #pre_skip?, #scan, #to_p

Constructor Details

#initializeControlParser

Returns a new instance of ControlParser.



182
183
184
# File 'lib/spectre/string/primitives.rb', line 182

def initialize
    super(["\0", "\a", "\b", "\t", "\n", "\f", "\r", "\e", "\s"])
end

Instance Method Details

#inspectObject



186
187
188
# File 'lib/spectre/string/primitives.rb', line 186

def inspect
    "[control_char]"
end