/src/xpdf-4.05/xpdf/Lexer.cc
Line | Count | Source (jump to first uncovered line) |
1 | | //======================================================================== |
2 | | // |
3 | | // Lexer.cc |
4 | | // |
5 | | // Copyright 1996-2003 Glyph & Cog, LLC |
6 | | // |
7 | | //======================================================================== |
8 | | |
9 | | #include <aconf.h> |
10 | | |
11 | | #include <stdlib.h> |
12 | | #include <stddef.h> |
13 | | #include <string.h> |
14 | | #include <ctype.h> |
15 | | #include "gmempp.h" |
16 | | #include "Lexer.h" |
17 | | #include "Error.h" |
18 | | |
19 | | //------------------------------------------------------------------------ |
20 | | |
21 | | // A '1' in this array means the character is white space. A '1' or |
22 | | // '2' means the character ends a name or command. |
23 | | static char specialChars[256] = { |
24 | | 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x |
25 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x |
26 | | 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x |
27 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x |
28 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x |
29 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x |
30 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x |
31 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x |
32 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x |
33 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x |
34 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax |
35 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx |
36 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx |
37 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx |
38 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex |
39 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx |
40 | | }; |
41 | | |
42 | | //------------------------------------------------------------------------ |
43 | | // Lexer |
44 | | //------------------------------------------------------------------------ |
45 | | |
46 | 361k | Lexer::Lexer(XRef *xref, Stream *str) { |
47 | 361k | Object obj; |
48 | | |
49 | 361k | curStr.initStream(str); |
50 | 361k | streams = new Array(xref); |
51 | 361k | streams->add(curStr.copy(&obj)); |
52 | 361k | strPtr = 0; |
53 | 361k | freeArray = gTrue; |
54 | 361k | curStr.streamReset(); |
55 | 361k | } |
56 | | |
57 | 0 | Lexer::Lexer(XRef *xref, Object *obj) { |
58 | 0 | Object obj2; |
59 | |
|
60 | 0 | if (obj->isStream()) { |
61 | 0 | streams = new Array(xref); |
62 | 0 | freeArray = gTrue; |
63 | 0 | streams->add(obj->copy(&obj2)); |
64 | 0 | } else { |
65 | 0 | streams = obj->getArray(); |
66 | 0 | freeArray = gFalse; |
67 | 0 | } |
68 | 0 | strPtr = 0; |
69 | 0 | if (streams->getLength() > 0) { |
70 | 0 | streams->get(strPtr, &curStr); |
71 | 0 | curStr.streamReset(); |
72 | 0 | } |
73 | 0 | } |
74 | | |
75 | 361k | Lexer::~Lexer() { |
76 | 361k | if (!curStr.isNone()) { |
77 | 149k | curStr.streamClose(); |
78 | 149k | curStr.free(); |
79 | 149k | } |
80 | 361k | if (freeArray) { |
81 | 361k | delete streams; |
82 | 361k | } |
83 | 361k | } |
84 | | |
85 | 1.03G | int Lexer::getChar() { |
86 | 1.03G | int c; |
87 | | |
88 | 1.03G | c = EOF; |
89 | 1.03G | while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) { |
90 | 211k | curStr.streamClose(); |
91 | 211k | curStr.free(); |
92 | 211k | ++strPtr; |
93 | 211k | if (strPtr < streams->getLength()) { |
94 | 0 | streams->get(strPtr, &curStr); |
95 | 0 | curStr.streamReset(); |
96 | 0 | } |
97 | 211k | } |
98 | 1.03G | return c; |
99 | 1.03G | } |
100 | | |
101 | 303M | int Lexer::lookChar() { |
102 | 303M | if (curStr.isNone()) { |
103 | 617 | return EOF; |
104 | 617 | } |
105 | 303M | return curStr.streamLookChar(); |
106 | 303M | } |
107 | | |
108 | 208M | Object *Lexer::getObj(Object *obj) { |
109 | 208M | char *p; |
110 | 208M | int c, c2; |
111 | 208M | GBool comment, neg, doubleMinus, done, invalid; |
112 | 208M | int numParen, nErrors; |
113 | 208M | int xi; |
114 | 208M | double xf, scale; |
115 | 208M | GString *s; |
116 | 208M | int n, m; |
117 | | |
118 | | // skip whitespace and comments |
119 | 208M | comment = gFalse; |
120 | 375M | while (1) { |
121 | 375M | if ((c = getChar()) == EOF) { |
122 | 156M | return obj->initEOF(); |
123 | 156M | } |
124 | 218M | if (comment) { |
125 | 19.2M | if (c == '\r' || c == '\n') |
126 | 236k | comment = gFalse; |
127 | 199M | } else if (c == '%') { |
128 | 237k | comment = gTrue; |
129 | 199M | } else if (specialChars[c] != 1) { |
130 | 52.3M | break; |
131 | 52.3M | } |
132 | 218M | } |
133 | | |
134 | | // start reading token |
135 | 52.3M | switch (c) { |
136 | | |
137 | | // number |
138 | 7.14M | case '0': case '1': case '2': case '3': case '4': |
139 | 9.16M | case '5': case '6': case '7': case '8': case '9': |
140 | 9.72M | case '+': case '-': case '.': |
141 | | // Adobe's number lexer has some "interesting" behavior: |
142 | | // "--123" is interpreted as 0 |
143 | | // "--123.4" is interpreted as -123.4 [I've seen this in the wild] |
144 | | // "50-100" is interpreted as 50 [I've seen this in the wild] |
145 | | // "50--100" is interpreted as 50 |
146 | | // "50-100.0" is an error -- but older versions of Acrobat may |
147 | | // have interpreted it as 50100.0 (?) |
148 | | // "50--100.0" is an error -- but older versions of Acrobat may |
149 | | // have interpreted it as 50100.0 (?) |
150 | | // "50.0-100" is interpreted as 50.0 (or maybe 50.0100?) |
151 | | // "50.0--100" is interpreted as 50.0 (or maybe 50.0100?) |
152 | | // "-50-100" is interpreted as -50 |
153 | | // "-" is interpreted as 0 |
154 | | // "-." is interpreted as 0.0 |
155 | 9.72M | neg = gFalse; |
156 | 9.72M | doubleMinus = gFalse; |
157 | 9.72M | xf = xi = 0; |
158 | 9.72M | if (c == '+') { |
159 | | // just ignore it |
160 | 9.68M | } else if (c == '-') { |
161 | 277k | neg = gTrue; |
162 | 277k | if (lookChar() == '-') { |
163 | 10.0k | doubleMinus = gTrue; |
164 | 15.5k | do { |
165 | 15.5k | getChar(); |
166 | 15.5k | } while (lookChar() == '-'); |
167 | 10.0k | } |
168 | 9.40M | } else if (c == '.') { |
169 | 241k | goto doReal; |
170 | 9.16M | } else { |
171 | 9.16M | xf = xi = c - '0'; |
172 | 9.16M | } |
173 | 21.7M | while (1) { |
174 | 21.7M | c = lookChar(); |
175 | 21.7M | if (isdigit(c)) { |
176 | 12.2M | getChar(); |
177 | 12.2M | xi = xi * 10 + (c - '0'); |
178 | 12.2M | if (xf < 1e20) { |
179 | 12.2M | xf = xf * 10 + (c - '0'); |
180 | 12.2M | } |
181 | 12.2M | } else if (c == '.') { |
182 | 658k | getChar(); |
183 | 658k | goto doReal; |
184 | 8.82M | } else { |
185 | 8.82M | break; |
186 | 8.82M | } |
187 | 21.7M | } |
188 | 8.83M | while ((c = lookChar()) == '-' || isdigit(c)) { |
189 | 6.72k | getChar(); |
190 | 6.72k | } |
191 | 8.82M | if (neg) { |
192 | 271k | xi = -xi; |
193 | 271k | } |
194 | 8.82M | if (doubleMinus) { |
195 | 10.0k | xi = 0; |
196 | 10.0k | } |
197 | 8.82M | obj->initInt(xi); |
198 | 8.82M | break; |
199 | 899k | doReal: |
200 | 899k | scale = 0.1; |
201 | 1.89M | while (1) { |
202 | 1.89M | c = lookChar(); |
203 | 1.89M | if (c == '-') { |
204 | 5.03k | error(errSyntaxWarning, getPos(), "Badly formatted number"); |
205 | 5.03k | getChar(); |
206 | 5.03k | continue; |
207 | 5.03k | } |
208 | 1.89M | if (!isdigit(c)) { |
209 | 899k | break; |
210 | 899k | } |
211 | 991k | getChar(); |
212 | 991k | xf = xf + scale * (c - '0'); |
213 | 991k | scale *= 0.1; |
214 | 991k | } |
215 | 899k | while ((c = lookChar()) == '-' || isdigit(c)) { |
216 | 0 | getChar(); |
217 | 0 | } |
218 | 899k | if (neg) { |
219 | 5.39k | xf = -xf; |
220 | 5.39k | } |
221 | 899k | obj->initReal(xf); |
222 | 899k | break; |
223 | | |
224 | | // string |
225 | 317k | case '(': |
226 | 317k | p = tokBuf; |
227 | 317k | n = 0; |
228 | 317k | numParen = 1; |
229 | 317k | done = gFalse; |
230 | 317k | s = NULL; |
231 | 356M | do { |
232 | 356M | c2 = EOF; |
233 | 356M | switch (c = getChar()) { |
234 | | |
235 | 10.3k | case EOF: |
236 | 10.3k | error(errSyntaxError, getPos(), "Unterminated string"); |
237 | 10.3k | done = gTrue; |
238 | 10.3k | break; |
239 | | |
240 | 538k | case '(': |
241 | 538k | ++numParen; |
242 | 538k | c2 = c; |
243 | 538k | break; |
244 | | |
245 | 765k | case ')': |
246 | 765k | if (--numParen == 0) { |
247 | 307k | done = gTrue; |
248 | 457k | } else { |
249 | 457k | c2 = c; |
250 | 457k | } |
251 | 765k | break; |
252 | | |
253 | 5.10M | case '\r': |
254 | | // The PDF spec says that any literal end-of-line sequence |
255 | | // (LF, CR, CR+LF) is translated to a single LF char. |
256 | 5.10M | c = lookChar(); |
257 | 5.10M | if (c == '\n') { |
258 | 243k | getChar(); |
259 | 243k | } |
260 | 5.10M | c2 = '\n'; |
261 | 5.10M | break; |
262 | | |
263 | 247k | case '\\': |
264 | 247k | switch (c = getChar()) { |
265 | 1.71k | case 'n': |
266 | 1.71k | c2 = '\n'; |
267 | 1.71k | break; |
268 | 15.3k | case 'r': |
269 | 15.3k | c2 = '\r'; |
270 | 15.3k | break; |
271 | 22.2k | case 't': |
272 | 22.2k | c2 = '\t'; |
273 | 22.2k | break; |
274 | 1.61k | case 'b': |
275 | 1.61k | c2 = '\b'; |
276 | 1.61k | break; |
277 | 103 | case 'f': |
278 | 103 | c2 = '\f'; |
279 | 103 | break; |
280 | 4.08k | case '\\': |
281 | 13.7k | case '(': |
282 | 24.7k | case ')': |
283 | 24.7k | c2 = c; |
284 | 24.7k | break; |
285 | 26.2k | case '0': case '1': case '2': case '3': |
286 | 50.7k | case '4': case '5': case '6': case '7': |
287 | 50.7k | c2 = c - '0'; |
288 | 50.7k | c = lookChar(); |
289 | 50.7k | if (c >= '0' && c <= '7') { |
290 | 19.6k | getChar(); |
291 | 19.6k | c2 = (c2 << 3) + (c - '0'); |
292 | 19.6k | c = lookChar(); |
293 | 19.6k | if (c >= '0' && c <= '7') { |
294 | 843 | getChar(); |
295 | 843 | c2 = (c2 << 3) + (c - '0'); |
296 | 843 | } |
297 | 19.6k | } |
298 | 50.7k | break; |
299 | 2.98k | case '\r': |
300 | 2.98k | c = lookChar(); |
301 | 2.98k | if (c == '\n') { |
302 | 1.07k | getChar(); |
303 | 1.07k | } |
304 | 2.98k | break; |
305 | 6.51k | case '\n': |
306 | 6.51k | break; |
307 | 1 | case EOF: |
308 | 1 | error(errSyntaxError, getPos(), "Unterminated string"); |
309 | 1 | done = gTrue; |
310 | 1 | break; |
311 | 121k | default: |
312 | 121k | c2 = c; |
313 | 121k | break; |
314 | 247k | } |
315 | 247k | break; |
316 | | |
317 | 349M | default: |
318 | 349M | c2 = c; |
319 | 349M | break; |
320 | 356M | } |
321 | | |
322 | 356M | if (c2 != EOF) { |
323 | 356M | if (n == tokBufSize) { |
324 | 2.68M | if (!s) |
325 | 72.0k | s = new GString(tokBuf, tokBufSize); |
326 | 2.61M | else |
327 | 2.61M | s->append(tokBuf, tokBufSize); |
328 | 2.68M | p = tokBuf; |
329 | 2.68M | n = 0; |
330 | 2.68M | } |
331 | 356M | *p++ = (char)c2; |
332 | 356M | ++n; |
333 | 356M | } |
334 | 356M | } while (!done); |
335 | 317k | if (!s) |
336 | 245k | s = new GString(tokBuf, n); |
337 | 72.0k | else |
338 | 72.0k | s->append(tokBuf, n); |
339 | 317k | obj->initString(s); |
340 | 317k | break; |
341 | | |
342 | | // name |
343 | 8.69M | case '/': |
344 | 8.69M | p = tokBuf; |
345 | 8.69M | n = 0; |
346 | 8.69M | s = NULL; |
347 | 8.69M | invalid = gFalse; |
348 | 37.2M | while ((c = lookChar()) != EOF && !specialChars[c]) { |
349 | 28.5M | getChar(); |
350 | 28.5M | if (c == '#') { |
351 | 821k | c2 = lookChar(); |
352 | 821k | if (c2 >= '0' && c2 <= '9') { |
353 | 1.96k | c = c2 - '0'; |
354 | 819k | } else if (c2 >= 'A' && c2 <= 'F') { |
355 | 46.4k | c = c2 - 'A' + 10; |
356 | 773k | } else if (c2 >= 'a' && c2 <= 'f') { |
357 | 95.6k | c = c2 - 'a' + 10; |
358 | 677k | } else { |
359 | 677k | error(errSyntaxError, getPos(), "Invalid hex escape in name"); |
360 | 677k | goto notEscChar; |
361 | 677k | } |
362 | 144k | getChar(); |
363 | 144k | c2 = lookChar(); |
364 | 144k | if (c2 >= '0' && c2 <= '9') { |
365 | 27.5k | c = (c << 4) + (c2 - '0'); |
366 | 116k | } else if (c2 >= 'A' && c2 <= 'F') { |
367 | 46.3k | c = (c << 4) + (c2 - 'A' + 10); |
368 | 70.1k | } else if (c2 >= 'a' && c2 <= 'f') { |
369 | 721 | c = (c << 4) + (c2 - 'a' + 10); |
370 | 69.4k | } else { |
371 | 69.4k | error(errSyntaxError, getPos(), "Invalid hex escape in name"); |
372 | 69.4k | goto notEscChar; |
373 | 69.4k | } |
374 | 74.6k | getChar(); |
375 | 74.6k | if (c == 0) { |
376 | 410 | invalid = gTrue; |
377 | 410 | } |
378 | 74.6k | } |
379 | 28.5M | notEscChar: |
380 | | // the PDF spec claims that names are limited to 127 chars, but |
381 | | // Distiller 8 will produce longer names, and Acrobat 8 will |
382 | | // accept longer names |
383 | 28.5M | ++n; |
384 | 28.5M | if (n < tokBufSize) { |
385 | 27.6M | *p++ = (char)c; |
386 | 27.6M | } else if (n == tokBufSize) { |
387 | 527 | *p = (char)c; |
388 | 527 | s = new GString(tokBuf, n); |
389 | 925k | } else { |
390 | 925k | s->append((char)c); |
391 | 925k | } |
392 | 28.5M | } |
393 | 8.69M | if (invalid) { |
394 | 410 | error(errSyntaxError, getPos(), "Null character in name"); |
395 | 410 | obj->initError(); |
396 | 410 | if (s) { |
397 | 0 | delete s; |
398 | 0 | } |
399 | 8.69M | } else if (n < tokBufSize) { |
400 | 8.69M | *p = '\0'; |
401 | 8.69M | obj->initName(tokBuf); |
402 | 8.69M | } else { |
403 | 527 | obj->initName(s->getCString()); |
404 | 527 | delete s; |
405 | 527 | } |
406 | 8.69M | break; |
407 | | |
408 | | // array punctuation |
409 | 5.31M | case '[': |
410 | 5.94M | case ']': |
411 | 5.94M | tokBuf[0] = (char)c; |
412 | 5.94M | tokBuf[1] = '\0'; |
413 | 5.94M | obj->initCmd(tokBuf); |
414 | 5.94M | break; |
415 | | |
416 | | // hex string or dict punctuation |
417 | 4.14M | case '<': |
418 | 4.14M | c = lookChar(); |
419 | | |
420 | | // dict punctuation |
421 | 4.14M | if (c == '<') { |
422 | 3.39M | getChar(); |
423 | 3.39M | tokBuf[0] = tokBuf[1] = '<'; |
424 | 3.39M | tokBuf[2] = '\0'; |
425 | 3.39M | obj->initCmd(tokBuf); |
426 | | |
427 | | // hex string |
428 | 3.39M | } else { |
429 | 745k | p = tokBuf; |
430 | 745k | m = n = 0; |
431 | 745k | c2 = 0; |
432 | 745k | s = NULL; |
433 | 745k | nErrors = 0; |
434 | 51.0M | while (nErrors < 100) { |
435 | 50.8M | c = getChar(); |
436 | 50.8M | if (c == '>') { |
437 | 587k | break; |
438 | 50.2M | } else if (c == EOF) { |
439 | 2.14k | error(errSyntaxError, getPos(), "Unterminated hex string"); |
440 | 2.14k | break; |
441 | 50.2M | } else if (specialChars[c] != 1) { |
442 | 44.1M | c2 = c2 << 4; |
443 | 44.1M | if (c >= '0' && c <= '9') { |
444 | 4.99M | c2 += c - '0'; |
445 | 39.1M | } else if (c >= 'A' && c <= 'F') { |
446 | 749k | c2 += c - 'A' + 10; |
447 | 38.4M | } else if (c >= 'a' && c <= 'f') { |
448 | 6.18M | c2 += c - 'a' + 10; |
449 | 32.2M | } else { |
450 | 32.2M | error(errSyntaxError, getPos(), |
451 | 32.2M | "Illegal character <{0:02x}> in hex string", c); |
452 | 32.2M | ++nErrors; |
453 | 32.2M | } |
454 | 44.1M | if (++m == 2) { |
455 | 21.9M | if (n == tokBufSize) { |
456 | 3.42k | if (!s) |
457 | 1.01k | s = new GString(tokBuf, tokBufSize); |
458 | 2.40k | else |
459 | 2.40k | s->append(tokBuf, tokBufSize); |
460 | 3.42k | p = tokBuf; |
461 | 3.42k | n = 0; |
462 | 3.42k | } |
463 | 21.9M | *p++ = (char)c2; |
464 | 21.9M | ++n; |
465 | 21.9M | c2 = 0; |
466 | 21.9M | m = 0; |
467 | 21.9M | } |
468 | 44.1M | } |
469 | 50.8M | } |
470 | 745k | if (!s) |
471 | 744k | s = new GString(tokBuf, n); |
472 | 1.01k | else |
473 | 1.01k | s->append(tokBuf, n); |
474 | 745k | if (m == 1) |
475 | 343k | s->append((char)(c2 << 4)); |
476 | 745k | obj->initString(s); |
477 | 745k | } |
478 | 4.14M | break; |
479 | | |
480 | | // dict punctuation |
481 | 3.36M | case '>': |
482 | 3.36M | c = lookChar(); |
483 | 3.36M | if (c == '>') { |
484 | 2.28M | getChar(); |
485 | 2.28M | tokBuf[0] = tokBuf[1] = '>'; |
486 | 2.28M | tokBuf[2] = '\0'; |
487 | 2.28M | obj->initCmd(tokBuf); |
488 | 2.28M | } else { |
489 | 1.08M | error(errSyntaxError, getPos(), "Illegal character '>'"); |
490 | 1.08M | obj->initError(); |
491 | 1.08M | } |
492 | 3.36M | break; |
493 | | |
494 | | // error |
495 | 1.06M | case ')': |
496 | 1.24M | case '{': |
497 | 1.33M | case '}': |
498 | 1.33M | error(errSyntaxError, getPos(), "Illegal character '{0:c}'", c); |
499 | 1.33M | obj->initError(); |
500 | 1.33M | break; |
501 | | |
502 | | // command |
503 | 18.8M | default: |
504 | 18.8M | p = tokBuf; |
505 | 18.8M | *p++ = (char)c; |
506 | 18.8M | n = 1; |
507 | 219M | while ((c = lookChar()) != EOF && !specialChars[c]) { |
508 | 201M | getChar(); |
509 | 201M | if (++n == tokBufSize) { |
510 | 951k | error(errSyntaxError, getPos(), "Command token too long"); |
511 | 951k | break; |
512 | 951k | } |
513 | 200M | *p++ = (char)c; |
514 | 200M | } |
515 | 18.8M | *p = '\0'; |
516 | 18.8M | if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) { |
517 | 70.5k | obj->initBool(gTrue); |
518 | 18.7M | } else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) { |
519 | 2.72k | obj->initBool(gFalse); |
520 | 18.7M | } else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) { |
521 | 924 | obj->initNull(); |
522 | 18.7M | } else { |
523 | 18.7M | obj->initCmd(tokBuf); |
524 | 18.7M | } |
525 | 18.8M | break; |
526 | 52.3M | } |
527 | | |
528 | 52.3M | return obj; |
529 | 52.3M | } |
530 | | |
531 | 131k | void Lexer::skipToNextLine() { |
532 | 131k | int c; |
533 | | |
534 | 491k | while (1) { |
535 | 491k | c = getChar(); |
536 | 491k | if (c == EOF || c == '\n') { |
537 | 25.6k | return; |
538 | 25.6k | } |
539 | 465k | if (c == '\r') { |
540 | 105k | if ((c = lookChar()) == '\n') { |
541 | 91.4k | getChar(); |
542 | 91.4k | } |
543 | 105k | return; |
544 | 105k | } |
545 | 465k | } |
546 | 131k | } |
547 | | |
548 | 40.7k | void Lexer::skipToEOF() { |
549 | 1.76M | while (getChar() != EOF) ; |
550 | 40.7k | } |
551 | | |
552 | 50.2M | GBool Lexer::isSpace(int c) { |
553 | 50.2M | return c >= 0 && c <= 0xff && specialChars[c] == 1; |
554 | 50.2M | } |