3
Copyright 2009 Taco Hoekwater <taco@luatex.org>
5
This file is part of LuaTeX.
7
LuaTeX is free software; you can redistribute it and/or modify it under
8
the terms of the GNU General Public License as published by the Free
9
Software Foundation; either version 2 of the License, or (at your
10
option) any later version.
12
LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15
License for more details.
17
You should have received a copy of the GNU General Public License along
18
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
20
/* $Id: conditional.h 3261 2009-12-18 11:38:21Z taco $ */
23
# define CONDITIONAL_H
26
# define unless_code 32 /* amount added for `\.{\\unless}' prefix */
29
if_char_code = 0, /* `\.{\\if}' */
30
if_cat_code = 1, /* `\.{\\ifcat}' */
31
if_int_code = 2, /* `\.{\\ifnum}' */
32
if_dim_code = 3, /* `\.{\\ifdim}' */
33
if_odd_code = 4, /* `\.{\\ifodd}' */
34
if_vmode_code = 5, /* `\.{\\ifvmode}' */
35
if_hmode_code = 6, /* `\.{\\ifhmode}' */
36
if_mmode_code = 7, /* `\.{\\ifmmode}' */
37
if_inner_code = 8, /* `\.{\\ifinner}' */
38
if_void_code = 9, /* `\.{\\ifvoid}' */
39
if_hbox_code = 10, /* `\.{\\ifhbox}' */
40
if_vbox_code = 11, /* `\.{\\ifvbox}' */
41
ifx_code = 12, /* `\.{\\ifx}' */
42
if_eof_code = 13, /* `\.{\\ifeof}' */
43
if_true_code = 14, /* `\.{\\iftrue}' */
44
if_false_code = 15, /* `\.{\\iffalse}' */
45
if_case_code = 16, /* `\.{\\ifcase}' */
46
if_def_code = 17, /* `\.{\\ifdefined}' */
47
if_cs_code = 18, /* `\.{\\ifcsname}' */
48
if_font_char_code = 19, /* `\.{\\iffontchar}' */
49
if_in_csname_code = 20, /* `\.{\\ifincsname}' */
50
if_primitive_code = 21, /* `\.{\\ifprimitive}' */
51
if_abs_num_code = 22, /* `\.{\\ifabsnum}' */
52
if_abs_dim_code = 23, /* `\.{\\ifabsdim}' */
58
# define if_limit_subtype(A) subtype((A)+1)
59
# define if_limit_type(A) type((A)+1)
60
# define if_line_field(A) vlink((A)+1)
63
if_code = 1, /* code for \.{\\if...} being evaluated */
64
fi_code = 2, /* code for \.{\\fi} */
65
else_code = 3, /* code for \.{\\else} */
66
or_code = 4, /* code for \.{\\or} */
69
extern halfword cond_ptr; /* top of the condition stack */
70
extern int if_limit; /* upper bound on |fi_or_else| codes */
71
extern int cur_if; /* type of conditional being worked on */
72
extern int if_line; /* line where that conditional began */
73
extern int skip_line; /* skipping began here */
75
extern void pass_text(void);
76
extern void push_condition_stack(void);
77
extern void pop_condition_stack(void);
78
extern void change_if_limit(int l, halfword p);
80
extern void conditional(void);