Skip to content

Instantly share code, notes, and snippets.

@Katee
Created December 1, 2013 03:38
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 Katee/7728251 to your computer and use it in GitHub Desktop.
Save Katee/7728251 to your computer and use it in GitHub Desktop.
var Literal = {
consume: function(literal, tokens) {
if (tokens !== undefined && tokens[0] !== undefined && tokens[0].content === literal) {
return [tokens[0], tokens.slice(1)];
}
return [null, tokens];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment