Class: Spectre::StringParsing::PrintParser
- Inherits:
-
Object
- Object
- Spectre::StringParsing::PrintParser
show all
- Includes:
- Parser
- Defined in:
- lib/spectre/string/primitives.rb
Overview
Matches printable characters. Shortcut: print_char
.
Instance Attribute Summary
Attributes included from Parser
#node
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Parser
#backtrack, #create_match, from_POD, #pre_skip?, #to_p
Instance Method Details
#inspect ⇒ Object
266
267
268
|
# File 'lib/spectre/string/primitives.rb', line 266
def inspect
"[print_char]"
end
|
#scan(iter) ⇒ Object
255
256
257
258
259
260
261
262
263
264
|
# File 'lib/spectre/string/primitives.rb', line 255
def scan iter
return nil unless iter.valid?
char = +iter
if char and char[0].between? 32, 126
create_match iter, char
else
nil
end
end
|