MCPcopy Create free account
hub / github.com/LibreOffice/core / control

Function control

soltools/cpp/_cpp.c:113–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void control(Tokenrow* trp)
114{
115 Nlist* np;
116 Token* tp;
117
118 tp = trp->tp;
119 if (tp->type != NAME)
120 {
121 if (tp->type == NUMBER)
122 goto kline;
123 if (tp->type != NL)
124 error(ERROR, "Unidentifiable control line");
125 return; /* else empty line */
126 }
127 np = lookup(tp, 0);
128 if (np == NULL || ((np->flag & ISKW) == 0 && !skipping))
129 {
130 error(WARNING, "Unknown preprocessor control %t", tp);
131 return;
132 }
133 if (skipping)
134 {
135 switch (np->val)
136 {
137 case KENDIF:
138 if (--ifdepth < skipping)
139 skipping = 0;
140 --cursource->ifdepth;
141 setempty(trp);
142 return;
143
144 case KIFDEF:
145 case KIFNDEF:
146 case KIF:
147 if (++ifdepth >= NIF)
148 error(FATAL, "#if too deeply nested");
149 ++cursource->ifdepth;
150 return;
151
152 case KELIF:
153 case KELSE:
154 if (ifdepth <= skipping)
155 break;
156 return;
157
158 default:
159 return;
160 }
161 }
162 switch (np->val)
163 {
164 case KDEFINE:
165 dodefine(trp);
166 break;
167
168 case KUNDEF:
169 tp += 1;
170 if (tp->type != NAME || trp->lp - trp->bp != 4)

Callers 1

processFunction · 0.85

Calls 8

errorFunction · 0.85
setemptyFunction · 0.85
dodefineFunction · 0.85
evalFunction · 0.85
expandrowFunction · 0.85
newstringFunction · 0.85
doincludeFunction · 0.85
lookupFunction · 0.70

Tested by

no test coverage detected