Skip to content

Instantly share code, notes, and snippets.

@toptensoftware
Created October 26, 2016 03:19
Show Gist options
  • Select an option

  • Save toptensoftware/b4e4cceedb6b790be45fe2fec86dd2b2 to your computer and use it in GitHub Desktop.

Select an option

Save toptensoftware/b4e4cceedb6b790be45fe2fec86dd2b2 to your computer and use it in GitHub Desktop.
// Parenthesis?
if (_tokenizer.Token == Token.OpenParens)
{
// Skip '('
_tokenizer.NextToken();
// Parse a top-level expression
var node = ParseAddSubtract();
// Check and skip ')'
if (_tokenizer.Token != Token.CloseParens)
throw new SyntaxException("Missing close parenthesis");
_tokenizer.NextToken();
// Return
return node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment