3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/jkf/parser/base.rb', line 3
def parse(input)
@input = input.clone
@current_pos = 0
@reported_pos = 0
@cached_pos = 0
@cached_pos_details = { line: 1, column: 1, seenCR: false }
@max_fail_pos = 0
@max_fail_expected = []
@silent_fails = 0
@result = parse_root
if @result != :failded && @current_pos == @input.length
return @result
else
fail({ type: "end", description: "end of input" }) if @result != :failed && @current_pos < input.length
raise ParseError
end
end
|