File Coverage

blib/lib/Text/Xslate/PP/Const.pm
Criterion Covered Total %
statement 84 84 100.0
branch n/a
condition n/a
subroutine 28 28 100.0
pod n/a
total 112 112 100.0


line stmt bran cond sub pod time code
1             # This lines are automatically generated by tool/opcode_for_pp.PL.
2             # ANY CHANGES WILL BE LOST!
3             package Text::Xslate::PP::Const;
4 1     1   3 use strict;
  1         1  
  1         26  
5              
6 1     1   4 use parent qw(Exporter);
  1         1  
  1         4  
7              
8             {
9 1     1   42 no strict 'refs';
  1         1  
  1         81  
10             our @EXPORT = ( grep { defined &{$_} } sort keys %Text::Xslate::PP::Const:: );
11             our @EXPORT_OK = (@EXPORT, qw(%OPS @OPCODE @OPARGS));
12             our %EXPORT_TAGS = (
13             all => \@EXPORT_OK,
14             );
15             }
16              
17 1     1   3 use constant TXARGf_SV => 0x01;
  1         1  
  1         40  
18 1     1   3 use constant TXARGf_INT => 0x02;
  1         1  
  1         29  
19 1     1   3 use constant TXARGf_KEY => 0x04;
  1         1  
  1         36  
20 1     1   3 use constant TXARGf_VAR => 0x08;
  1         1  
  1         32  
21 1     1   3 use constant TXARGf_PC => 0x10;
  1         1  
  1         30  
22              
23             # note that these flags are different form XS's because
24             # of the difference of data structure
25 1     1   3 use constant TXCODE_W_SV => TXARGf_SV;
  1         1  
  1         39  
26 1     1   3 use constant TXCODE_W_SVIV => (TXARGf_SV | TXARGf_INT) ;
  1         1  
  1         32  
27 1     1   3 use constant TXCODE_W_KEY => (TXARGf_SV | TXARGf_KEY);
  1         1  
  1         35  
28 1     1   2 use constant TXCODE_W_INT => (TXARGf_SV | TXARGf_INT);
  1         5  
  1         49  
29 1     1   3 use constant TXCODE_W_VAR => (TXARGf_SV | TXARGf_INT | TXARGf_VAR);
  1         1  
  1         34  
30 1     1   3 use constant TXCODE_GOTO => (TXARGf_SV | TXARGf_INT | TXARGf_PC);
  1         1  
  1         33  
31              
32             # template representation, stored in $self->{template}{$file}
33 1     1   3 use constant TXo_MTIME => 0;
  1         1  
  1         28  
34 1     1   3 use constant TXo_CACHEPATH => 1;
  1         0  
  1         31  
35 1     1   3 use constant TXo_FULLPATH => 2;
  1         1  
  1         30  
36              
37             # vm execution frame
38 1     1   3 use constant TXframe_NAME => 0;
  1         1  
  1         27  
39 1     1   3 use constant TXframe_OUTPUT => 1;
  1         1  
  1         30  
40 1     1   3 use constant TXframe_RETADDR => 2;
  1         0  
  1         49  
41 1     1   4 use constant TXframe_START_LVAR => 3;
  1         2  
  1         49  
42              
43 1     1   3 use constant TX_VERBOSE_DEFAULT => 1;
  1         1  
  1         42  
44              
45             # for-loop variables
46 1     1   3 use constant TXfor_ITEM => 0;
  1         1  
  1         29  
47 1     1   3 use constant TXfor_ITER => 1;
  1         1  
  1         30  
48 1     1   3 use constant TXfor_ARRAY => 2;
  1         1  
  1         28  
49              
50             # types
51 1     1   2 use constant TXt_RAW => 'Text::Xslate::Type::Raw';
  1         1  
  1         32  
52 1     1   3 use constant TXt_MACRO => 'Text::Xslate::PP::Type::Macro';
  1         0  
  1         31  
53 1     1   3 use constant TXt_PAIR => 'Text::Xslate::PP::Type::Pair';
  1         1  
  1         541  
54              
55             our %OPS = (
56             noop => 0,
57             move_to_sb => 1,
58             move_from_sb => 2,
59             save_to_lvar => 3,
60             load_lvar => 4,
61             load_lvar_to_sb => 5,
62             localize_s => 6,
63             localize_vars => 7,
64             push => 8,
65             pushmark => 9,
66             nil => 10,
67             literal => 11,
68             literal_i => 12,
69             fetch_s => 13,
70             fetch_field => 14,
71             fetch_field_s => 15,
72             print => 16,
73             print_raw => 17,
74             print_raw_s => 18,
75             include => 19,
76             find_file => 20,
77             suffix => 21,
78             for_start => 22,
79             for_iter => 23,
80             add => 24,
81             sub => 25,
82             mul => 26,
83             div => 27,
84             mod => 28,
85             concat => 29,
86             repeat => 30,
87             bitor => 31,
88             bitand => 32,
89             bitxor => 33,
90             bitneg => 34,
91             and => 35,
92             dand => 36,
93             or => 37,
94             dor => 38,
95             not => 39,
96             minus => 40,
97             max_index => 41,
98             builtin_mark_raw => 42,
99             builtin_unmark_raw => 43,
100             builtin_uri_escape => 44,
101             builtin_is_array_ref => 45,
102             builtin_is_hash_ref => 46,
103             builtin_html_escape => 47,
104             is_code_ref => 48,
105             merge_hash => 49,
106             match => 50,
107             eq => 51,
108             ne => 52,
109             lt => 53,
110             le => 54,
111             gt => 55,
112             ge => 56,
113             ncmp => 57,
114             scmp => 58,
115             range => 59,
116             fetch_symbol => 60,
117             funcall => 61,
118             macro_end => 62,
119             methodcall_s => 63,
120             make_array => 64,
121             make_hash => 65,
122             enter => 66,
123             leave => 67,
124             goto => 68,
125             vars => 69,
126             depend => 70,
127             macro_begin => 71,
128             macro_nargs => 72,
129             macro_outer => 73,
130             set_opinfo => 74,
131             super => 75,
132             end => 76,
133             ); # %OPS
134              
135             our @OPCODE = (
136             \&Text::Xslate::PP::Opcode::op_noop, # 0
137             \&Text::Xslate::PP::Opcode::op_move_to_sb, # 1
138             \&Text::Xslate::PP::Opcode::op_move_from_sb, # 2
139             \&Text::Xslate::PP::Opcode::op_save_to_lvar, # 3
140             \&Text::Xslate::PP::Opcode::op_load_lvar, # 4
141             \&Text::Xslate::PP::Opcode::op_load_lvar_to_sb, # 5
142             \&Text::Xslate::PP::Opcode::op_localize_s, # 6
143             \&Text::Xslate::PP::Opcode::op_localize_vars, # 7
144             \&Text::Xslate::PP::Opcode::op_push, # 8
145             \&Text::Xslate::PP::Opcode::op_pushmark, # 9
146             \&Text::Xslate::PP::Opcode::op_nil, # 10
147             \&Text::Xslate::PP::Opcode::op_literal, # 11
148             \&Text::Xslate::PP::Opcode::op_literal_i, # 12
149             \&Text::Xslate::PP::Opcode::op_fetch_s, # 13
150             \&Text::Xslate::PP::Opcode::op_fetch_field, # 14
151             \&Text::Xslate::PP::Opcode::op_fetch_field_s, # 15
152             \&Text::Xslate::PP::Opcode::op_print, # 16
153             \&Text::Xslate::PP::Opcode::op_print_raw, # 17
154             \&Text::Xslate::PP::Opcode::op_print_raw_s, # 18
155             \&Text::Xslate::PP::Opcode::op_include, # 19
156             \&Text::Xslate::PP::Opcode::op_find_file, # 20
157             \&Text::Xslate::PP::Opcode::op_suffix, # 21
158             \&Text::Xslate::PP::Opcode::op_for_start, # 22
159             \&Text::Xslate::PP::Opcode::op_for_iter, # 23
160             \&Text::Xslate::PP::Opcode::op_add, # 24
161             \&Text::Xslate::PP::Opcode::op_sub, # 25
162             \&Text::Xslate::PP::Opcode::op_mul, # 26
163             \&Text::Xslate::PP::Opcode::op_div, # 27
164             \&Text::Xslate::PP::Opcode::op_mod, # 28
165             \&Text::Xslate::PP::Opcode::op_concat, # 29
166             \&Text::Xslate::PP::Opcode::op_repeat, # 30
167             \&Text::Xslate::PP::Opcode::op_bitor, # 31
168             \&Text::Xslate::PP::Opcode::op_bitand, # 32
169             \&Text::Xslate::PP::Opcode::op_bitxor, # 33
170             \&Text::Xslate::PP::Opcode::op_bitneg, # 34
171             \&Text::Xslate::PP::Opcode::op_and, # 35
172             \&Text::Xslate::PP::Opcode::op_dand, # 36
173             \&Text::Xslate::PP::Opcode::op_or, # 37
174             \&Text::Xslate::PP::Opcode::op_dor, # 38
175             \&Text::Xslate::PP::Opcode::op_not, # 39
176             \&Text::Xslate::PP::Opcode::op_minus, # 40
177             \&Text::Xslate::PP::Opcode::op_max_index, # 41
178             \&Text::Xslate::PP::Opcode::op_builtin_mark_raw, # 42
179             \&Text::Xslate::PP::Opcode::op_builtin_unmark_raw, # 43
180             \&Text::Xslate::PP::Opcode::op_builtin_uri_escape, # 44
181             \&Text::Xslate::PP::Opcode::op_builtin_is_array_ref, # 45
182             \&Text::Xslate::PP::Opcode::op_builtin_is_hash_ref, # 46
183             \&Text::Xslate::PP::Opcode::op_builtin_html_escape, # 47
184             \&Text::Xslate::PP::Opcode::op_is_code_ref, # 48
185             \&Text::Xslate::PP::Opcode::op_merge_hash, # 49
186             \&Text::Xslate::PP::Opcode::op_match, # 50
187             \&Text::Xslate::PP::Opcode::op_eq, # 51
188             \&Text::Xslate::PP::Opcode::op_ne, # 52
189             \&Text::Xslate::PP::Opcode::op_lt, # 53
190             \&Text::Xslate::PP::Opcode::op_le, # 54
191             \&Text::Xslate::PP::Opcode::op_gt, # 55
192             \&Text::Xslate::PP::Opcode::op_ge, # 56
193             \&Text::Xslate::PP::Opcode::op_ncmp, # 57
194             \&Text::Xslate::PP::Opcode::op_scmp, # 58
195             \&Text::Xslate::PP::Opcode::op_range, # 59
196             \&Text::Xslate::PP::Opcode::op_fetch_symbol, # 60
197             \&Text::Xslate::PP::Opcode::op_funcall, # 61
198             \&Text::Xslate::PP::Opcode::op_macro_end, # 62
199             \&Text::Xslate::PP::Opcode::op_methodcall_s, # 63
200             \&Text::Xslate::PP::Opcode::op_make_array, # 64
201             \&Text::Xslate::PP::Opcode::op_make_hash, # 65
202             \&Text::Xslate::PP::Opcode::op_enter, # 66
203             \&Text::Xslate::PP::Opcode::op_leave, # 67
204             \&Text::Xslate::PP::Opcode::op_goto, # 68
205             \&Text::Xslate::PP::Opcode::op_vars, # 69
206             \&Text::Xslate::PP::Opcode::op_depend, # 70
207             \&Text::Xslate::PP::Opcode::op_macro_begin, # 71
208             \&Text::Xslate::PP::Opcode::op_macro_nargs, # 72
209             \&Text::Xslate::PP::Opcode::op_macro_outer, # 73
210             \&Text::Xslate::PP::Opcode::op_set_opinfo, # 74
211             \&Text::Xslate::PP::Opcode::op_super, # 75
212             \&Text::Xslate::PP::Opcode::op_end, # 76
213             ); # @OPCODE
214              
215             our @OPARGS = (
216             0, # noop
217             0, # move_to_sb
218             0, # move_from_sb
219             TXCODE_W_VAR, # save_to_lvar
220             TXCODE_W_VAR, # load_lvar
221             TXCODE_W_VAR, # load_lvar_to_sb
222             TXCODE_W_KEY, # localize_s
223             0, # localize_vars
224             0, # push
225             0, # pushmark
226             0, # nil
227             TXCODE_W_SV, # literal
228             TXCODE_W_SVIV, # literal_i
229             TXCODE_W_KEY, # fetch_s
230             0, # fetch_field
231             TXCODE_W_KEY, # fetch_field_s
232             0, # print
233             0, # print_raw
234             TXCODE_W_SV, # print_raw_s
235             0, # include
236             0, # find_file
237             0, # suffix
238             TXCODE_W_VAR, # for_start
239             TXCODE_GOTO, # for_iter
240             0, # add
241             0, # sub
242             0, # mul
243             0, # div
244             0, # mod
245             TXCODE_W_SV, # concat
246             TXCODE_W_SV, # repeat
247             0, # bitor
248             0, # bitand
249             0, # bitxor
250             0, # bitneg
251             TXCODE_GOTO, # and
252             TXCODE_GOTO, # dand
253             TXCODE_GOTO, # or
254             TXCODE_GOTO, # dor
255             0, # not
256             0, # minus
257             0, # max_index
258             0, # builtin_mark_raw
259             0, # builtin_unmark_raw
260             0, # builtin_uri_escape
261             0, # builtin_is_array_ref
262             0, # builtin_is_hash_ref
263             0, # builtin_html_escape
264             0, # is_code_ref
265             0, # merge_hash
266             0, # match
267             0, # eq
268             0, # ne
269             0, # lt
270             0, # le
271             0, # gt
272             0, # ge
273             0, # ncmp
274             0, # scmp
275             0, # range
276             TXCODE_W_KEY, # fetch_symbol
277             0, # funcall
278             0, # macro_end
279             TXCODE_W_KEY, # methodcall_s
280             0, # make_array
281             0, # make_hash
282             0, # enter
283             0, # leave
284             TXCODE_GOTO, # goto
285             0, # vars
286             TXCODE_W_SV, # depend
287             TXCODE_W_KEY, # macro_begin
288             TXCODE_W_SVIV, # macro_nargs
289             TXCODE_W_SVIV, # macro_outer
290             0, # set_opinfo
291             0, # super
292             0, # end
293             ); # @OPARGS
294              
295             1;
296             __END__