Switch cases are not followed by colon

This commit is contained in:
Alex Beregszaszi
2017-05-26 03:20:15 +01:00
parent 66eab1caf6
commit db3d9e0416
2 changed files with 2 additions and 3 deletions
-1
View File
@@ -161,7 +161,6 @@ assembly::Case Parser::parseCase(bool _defaultCase)
fatalParserError("Literal expected.");
_case.value = make_shared<Literal>(std::move(boost::get<assembly::Literal>(statement)));
}
expectToken(Token::Colon);
_case.body = parseBlock();
_case.location.end = _case.body.location.end;
return _case;
+2 -2
View File
@@ -173,9 +173,9 @@ string AsmPrinter::operator()(Switch const& _switch)
for (auto const& _case: _switch.cases)
{
if (!_case.value)
out += "\ndefault: ";
out += "\ndefault ";
else
out += "\ncase " + (*this)(*_case.value) + ": ";
out += "\ncase " + (*this)(*_case.value) + " ";
out += (*this)(_case.body);
}
return out;