Skip to content

Instantly share code, notes, and snippets.

@aamedina
Created April 7, 2014 19:09
Show Gist options
  • Select an option

  • Save aamedina/10032440 to your computer and use it in GitHub Desktop.

Select an option

Save aamedina/10032440 to your computer and use it in GitHub Desktop.
static NSString *readToken (PushbackReader *rdr) {
NSMutableString *sb = [NSMutableString string];
unichar ch = [rdr read];
for (;;) {
if (!ch || isWhitespace(ch))
return [NSString stringWithString:sb];
[sb appendFormat:@"%C", ch];
ch = [rdr read];
}
return nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment