4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/packcr/generated/node/eof_node.rb', line 4
def get_code(gen, onfail, indent, unwrap, oncut)
case gen.lang
when :c
erbout = +""
erbout << "if (packcr_refill_buffer(ctx, 1) >= 1) goto L#{format("%04d", onfail)};\n".freeze
erbout
when :rb
erbout = +""
erbout << "if refill_buffer(1) >= 1\n throw(#{onfail})\nend\n".freeze
erbout
when :rs
erbout = +""
erbout << "/* lib/packcr/templates/node/eof.rs.erb */\n\n".freeze
erbout
else
raise "unknown lang #{gen.lang}"
end
end
|