#include "parseIdentifierOrStringLiteral.h" #include "ExpressionElementParsers.h" #include "ASTLiteral.h" #include "ASTIdentifier.h" #include namespace DB { bool parseIdentifierOrStringLiteral(IParser::Pos & pos, Expected & expected, String & result) { ASTPtr res; if (!ParserIdentifier().parse(pos, res, expected)) { if (!ParserStringLiteral().parse(pos, res, expected)) return false; result = typeid_cast(*res).value.safeGet(); } else result = typeid_cast(*res).name; return true; } }