Ejemplo n.º 1
0
 public FunctionDeclarationSyntax(SyntaxToken functionKeyword, SyntaxToken identifier, SyntaxToken openParenthesisToken, SeparatedSyntaxList <ParameterSyntax> parameters, SyntaxToken closeParenthesisToken, TypeClauseSyntax type, BlockStatementSynatx body)
 {
     FunctionKeyword       = functionKeyword;
     Identifier            = identifier;
     OpenParenthesisToken  = openParenthesisToken;
     Parameters            = parameters;
     CloseParenthesisToken = closeParenthesisToken;
     Type = type;
     Body = body;
 }
Ejemplo n.º 2
0
        private BoundStatement BindBlockStatement(BlockStatementSynatx syntax)
        {
            var statements = ImmutableArray.CreateBuilder <BoundStatement>();

            _scope = new BoundScope(_scope);

            foreach (var statementSyntax in syntax.Statements)
            {
                var statement = BindStatement(statementSyntax);
                statements.Add(statement);
            }
            _scope = _scope.Parent;

            return(new BoundBlockStatemnet(statements.ToImmutable()));
        }