Last active
September 4, 2018 19:38
-
-
Save ear/3526ffabd2668f48f31fdf30a1ae237c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scanner(FILE *fd) { | |
beginning: | |
c = fgetc(fd); | |
switch (c) { | |
case ' ': goto beginning; | |
case '\n': return TOKEN_NEWLINE; | |
default: fseek(fd, -1, SEEK_CUR); | |
} | |
... | |
fscanf(fd, "%[a-z...]", buffer); | |
... | |
fscanf(fd, "%2c", c); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment