示例#1
0
 public void Render(JassElseClauseSyntax elseClause)
 {
     WriteLine(JassKeyword.Else);
     Indent();
     Render(elseClause.Body);
     Outdent();
 }
示例#2
0
        public LuaElseClauseSyntax Transpile(JassElseClauseSyntax elseClause)
        {
            var luaElseClause = new LuaElseClauseSyntax();

            luaElseClause.Body.Statements.AddRange(Transpile(elseClause.Body));

            return(luaElseClause);
        }
示例#3
0
        private bool TryAdaptElseClause(JassMapScriptAdapterContext context, JassElseClauseSyntax?elseClause, [NotNullWhen(true)] out JassElseClauseSyntax?adaptedElseClause)
        {
            if (elseClause is not null &&
                TryAdaptStatementList(context, elseClause.Body, out var adaptedBody))
            {
                adaptedElseClause = new JassElseClauseSyntax(adaptedBody);
                return(true);
            }

            adaptedElseClause = null;
            return(false);
        }
示例#4
0
 public ElseClauseSyntax Transpile(JassElseClauseSyntax elseClause)
 {
     return(SyntaxFactory.ElseClause(SyntaxFactory.Block(Transpile(elseClause.Body))));
 }
示例#5
0
 public static JassIfStatementSyntax IfStatement(IExpressionSyntax condition, JassStatementListSyntax body, IEnumerable <JassElseIfClauseSyntax> elseIfClauses, JassElseClauseSyntax elseClause)
 {
     return(new JassIfStatementSyntax(
                condition,
                body,
                elseIfClauses.ToImmutableArray(),
                elseClause));
 }
示例#6
0
 public static JassIfStatementSyntax IfStatement(IExpressionSyntax condition, JassStatementListSyntax body, JassElseClauseSyntax elseClause)
 {
     return(new JassIfStatementSyntax(
                condition,
                body,
                ImmutableArray.Create <JassElseIfClauseSyntax>(),
                elseClause));
 }