// throws on error public KeyValueAST ParseKeyValue() { var ast = new KeyValueAST(); ast.key = ParseIdentifier(); if (Tok() != TokenType.Eq) { throw new Exception(GetErrorMsg()); } Inc(); // skip '=' ast.value = ParseValue(); SkipIf(TokenType.Semicolon); return(ast); }
// throws on error public KeyValueAST ParseKeyValue() { var ast = new KeyValueAST(); ast.key = ParseIdentifier(); if (Tok() != TokenType.Eq) throw new Exception( GetErrorMsg() ); Inc(); // skip '=' ast.value = ParseValue(); SkipIf( TokenType.Semicolon ); return ast; }