MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / unget

Function unget

tools/tokenizer/token_common.c:186–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void unget(int cc)
187{
188 if (cc == EOF) return;
189 if (buffered < MAX_BUF) {
190 if (cc == '\n' || cc == '\r') {
191 linenr--;
192 // column was 0 right after getting the \n
193 // hopefully there are no multiple ungets of \n
194 column = saved_col;
195 }
196 else
197 column--;
198 buffer[buffered++] = cc;
199 }
200 else {
201 fprintf(stderr, "(F): Lookahead buffer overflow (MAX=%u).\n", MAX_BUF);
202 exit(2);
203 }
204}
205
206/* Determine programming language from filename extension:
207 .c | C

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected