This commit is contained in:
Nikita Vasilev 2019-01-23 12:10:52 +03:00
parent 7996c6ab45
commit 296ad9163c
2 changed files with 6 additions and 5 deletions

View File

@ -119,10 +119,11 @@ private:
s.ostr << s.nl_or_ws << indent_str;
s.ostr << (s.hilite ? hilite_keyword : "") << prefix << (s.hilite ? hilite_none : "");
FormatStateStacked frame_nested = frame;
++frame_nested.indent;
FormatSettings nested_settings = s;
nested_settings.one_line = true;
nested_settings.nl_or_ws = ' ';
elem->formatImpl(s, state, frame_nested);
elem->formatImpl(nested_settings, state, frame);
}
};
public:

View File

@ -179,9 +179,9 @@ bool ParserColumnsOrIndicesDeclarationList::parseImpl(Pos & pos, ASTPtr & node,
for (const auto & elem : list->children)
{
if (dynamic_cast<const ASTColumnDeclaration *>(elem.get()))
if (typeid_cast<const ASTColumnDeclaration *>(elem.get()))
columns->children.push_back(elem);
else if (dynamic_cast<const ASTIndexDeclaration *>(elem.get()))
else if (typeid_cast<const ASTIndexDeclaration *>(elem.get()))
indices->children.push_back(elem);
else
return false;