Class: Spectre::StringParsing::SpaceParser

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

Overview

Matches spaces, tabs, returns and newlines. Shortcut: space_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

#initializeSpaceParser

Returns a new instance of SpaceParser.



304
305
306
# File 'lib/spectre/string/primitives.rb', line 304

def initialize
    super([" ", "\t", "\n", "\r"])
end

Instance Method Details

#inspectObject



308
309
310
# File 'lib/spectre/string/primitives.rb', line 308

def inspect
    "[space_char]"
end