Skip to content

Instantly share code, notes, and snippets.

@dilijev
Created January 20, 2013 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dilijev/4576361 to your computer and use it in GitHub Desktop.
Save dilijev/4576361 to your computer and use it in GitHub Desktop.
Indent open braces, code on the same line as the open brace, further indenting the block, LISP style "if ... else if ... else" hanging indents. I don't even....
TOKEN gettoken()
{ int c, cclass;
TOKEN tok = (TOKEN) talloc(); /* = new token */
skipblanks(); /* and comments */
if ((c = peekchar()) != EOF)
{
cclass = CHARCLASS[c];
if (cclass == ALPHA)
identifier(tok);
else if (cclass == NUMERIC)
number(tok);
else if (c == '\'')
getstring(tok);
else special(tok);
}
else EOFFLG = 1;
if (DEBUGGETTOKEN != 0) printtoken(tok);
return(tok);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment