Class: DParse::Parsers::Any
Instance Method Summary
collapse
#apply, #bind, #capture, #compact, #first, #flatten, #ignore, #map, #match?, #second, #select_even, #select_odd, #to_s
Instance Method Details
#expectation_message ⇒ Object
17
18
19
|
# File 'lib/d-parse/parsers/primitives/any.rb', line 17
def expectation_message
'any character except end of file'
end
|
#inspect ⇒ Object
13
14
15
|
# File 'lib/d-parse/parsers/primitives/any.rb', line 13
def inspect
'any()'
end
|
#read(input, pos) ⇒ Object
4
5
6
7
8
9
10
11
|
# File 'lib/d-parse/parsers/primitives/any.rb', line 4
def read(input, pos)
char = input[pos.index]
if char
Success.new(input, pos.advance(char))
else
Failure.new(input, pos, origin: self)
end
end
|