/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
case KUNDEF:
tp += 1; if (tp->type != NAME || trp->lp - trp->bp != 4)
{
error(ERROR, "Syntax error in #undef"); break;
} if ((np = lookup(tp, 0)) != NULL)
{
np->flag &= ~ISDEFINED;
if (Mflag)
{ if (np->ap)
error(INFO, "Macro deletion of %s(%r)", np->name, np->ap); else
error(INFO, "Macro deletion of %s", np->name);
}
} break;
case KPRAGMA: case KIDENT: for (tp = trp->tp - 1; ((tp->type != NL) && (tp < trp->lp)); tp++)
tp->type = UNCLASS; return;
case KIFDEF: case KIFNDEF: case KIF: if (++ifdepth >= NIF)
error(FATAL, "#if too deeply nested");
++cursource->ifdepth;
ifsatisfied[ifdepth] = 0; if (eval(trp, np->val))
ifsatisfied[ifdepth] = 1; else
skipping = ifdepth; break;
case KELIF: if (ifdepth == 0)
{
error(ERROR, "#elif with no #if"); return;
} if (ifsatisfied[ifdepth] == 2)
error(ERROR, "#elif after #else"); if (eval(trp, np->val))
{ if (ifsatisfied[ifdepth])
skipping = ifdepth; else
{
skipping = 0;
ifsatisfied[ifdepth] = 1;
}
} else
skipping = ifdepth; break;
case KELSE: if (ifdepth == 0 || cursource->ifdepth == 0)
{
error(ERROR, "#else with no #if"); return;
} if (ifsatisfied[ifdepth] == 2)
error(ERROR, "#else after #else"); if (trp->lp - trp->bp != 3)
error(ERROR, "Syntax error in #else");
skipping = ifsatisfied[ifdepth] ? ifdepth : 0;
ifsatisfied[ifdepth] = 2; break;
case KENDIF: if (ifdepth == 0 || cursource->ifdepth == 0)
{
error(ERROR, "#endif with no #if"); return;
}
--ifdepth;
--cursource->ifdepth; if (trp->lp - trp->bp != 3)
error(WARNING, "Syntax error in #endif"); break;
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 ist noch experimentell.