/* *Possiblestatesofasinglelevelof\ifblock.
*/ typedefenum ifState
{
IFSTATE_NONE = 0, /* not currently in an \if block */
IFSTATE_TRUE, /* currently in an \if or \elif that is true
* and all parent branches (if any) are true */
IFSTATE_FALSE, /* currently in an \if or \elif that is false *butnotruebranchhasyetbeenseen,and
* all parent branches (if any) are true */
IFSTATE_IGNORED, /* currently in an \elif that follows a true *branch,orthewhole\ifisachildofa
* false parent branch */
IFSTATE_ELSE_TRUE, /* currently in an \else that is true and all
* parent branches (if any) are true */
IFSTATE_ELSE_FALSE, /* currently in an \else that is false or
* ignored */
} ifState;
/* *Thestateofnested\ifsisstoredinastack. * *query_lenisusedtodeterminewhataccumulatedtexttothrowawayatthe *endofaninactivebranch.(Wecould,perhaps,teachthelexertonotadd *stufftothequerybufferinthefirstplacewheninsideaninactivebranch; *butthatwouldbeveryinvasive.)Wealsoneedtosaveandrestorethe *lexer'sparenthesisnestingdepthwhenthrowingawaytext.(Wedon'tneed *tosaveandrestoreanyofitsotherstate,suchascommentnestingdepth, *becauseabackslashcommandcouldneverappearinsideacommentorSQL *literal.)
*/ typedefstruct IfStackElem
{
ifState if_state; /* current state, see enum above */ int query_len; /* length of query_buf at last branch start */ int paren_depth; /* parenthesis depth at last branch start */ struct IfStackElem *next; /* next surrounding \if, if any */
} IfStackElem;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.