Esempio n. 1
0
 public BoundIfElseStatement(
     BoundExpression boundExpression,
     BoundScopeStatement boundStatements,
     BoundScopeStatement elseBoundStatements,
     IfElseStatementSyntax statementSyntax)
     : base(statementSyntax)
 {
     BoundExpression = boundExpression;
     BoundStatements = boundStatements;
     ElseBoundStatements = elseBoundStatements;
 }
Esempio n. 2
0
        private BoundStatement BindIfElseStatement(IfElseStatementSyntax syntax)
        {
            var boundExpression = BindExpression(syntax.Condition);
            Ensure(() => TypeEquals(boundExpression.Type, new BoolCompilerGeneratedType()), "If condition must be of Type Bool");

            var boundStatements = BindScope(syntax.Statements);
            var boundElseStatement = BindScope(syntax.ElseStatements);
            return new BoundIfElseStatement(boundExpression, boundStatements, boundElseStatement, syntax);
        }