Skip to content

Commit

Permalink
Merge branch 'release/0.40.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Jun 26, 2019
2 parents 83b0a1c + a9fb697 commit d49d1c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion build/ultratiny.flx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export ultratiny
import libc
import std::math


var value = 401.0

#if value > 30.0
Expand Down
9 changes: 5 additions & 4 deletions source/frontend/parser/controlflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,11 @@ namespace parser

c.body = parseBracedBlock(st);
cases.push_back(c);

if(isStaticIf) c.body->doNotPushNewScope = true;
}
else if(st.frontAfterWS() == TT::LBrace || st.frontAfterWS() == TT::FatRightArrow)
{
// ok, parse an else
elseCase = parseBracedBlock(st);
if(isStaticIf) elseCase->doNotPushNewScope = true;

break;
}
else
Expand All @@ -125,6 +121,11 @@ namespace parser
ret->cases = cases;
ret->elseCase = elseCase;

for(auto& c : ret->cases)
c.body->doNotPushNewScope = true;

ret->elseCase->doNotPushNewScope = true;

return ret;
}
else
Expand Down
4 changes: 1 addition & 3 deletions source/typecheck/directives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ TCResult ast::IfDirective::typecheck(sst::TypecheckState* fs, fir::Type* infer)

if(!execBlock)
{
// ok we need to return a fake value.
auto ret = util::pool<sst::RawValueExpr>(this->loc, fir::Type::getVoid());
return TCResult(ret);
return TCResult::getDummy();
}
else
{
Expand Down

0 comments on commit d49d1c3

Please sign in to comment.