From 01136c6796e21f023713e026674576d8e623462d Mon Sep 17 00:00:00 2001 From: EVE Date: Mon, 13 Mar 2017 16:41:45 -0400 Subject: Formatting --- .../src/bjc/dicelang/v1/ast/DiceASTInliner.java | 42 +++++++++------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java') diff --git a/dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java b/dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java index 51aba03..38e1361 100644 --- a/dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java +++ b/dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java @@ -20,9 +20,9 @@ public class DiceASTInliner { * Inline all the variables in the AST * * @param ast - * The AST to inline variables into + * The AST to inline variables into * @param enviroment - * The enviroment to inline from + * The enviroment to inline from * @return The inlined AST */ public static ITree inlineAll(ITree ast, @@ -32,8 +32,7 @@ public class DiceASTInliner { return selectiveInline(ast, enviroment, (String[]) null); } - private static ITree inlineNode(IDiceASTNode node, - IMap> enviroment, + private static ITree inlineNode(IDiceASTNode node, IMap> enviroment, boolean specificInline, IList variableNames) { // Only variables get inlined if (node.getType() != DiceASTType.VARIABLE) { @@ -50,8 +49,7 @@ public class DiceASTInliner { // You can't inline non-existent variables if (!enviroment.containsKey(variableName)) { throw new UnsupportedOperationException( - "Attempted to inline non-existant variable " - + variableName); + "Attempted to inline non-existant variable " + variableName); } // Return the tree for the variable @@ -61,12 +59,11 @@ public class DiceASTInliner { // We're not inlining this particular variable return new Tree<>(node); } - + // You can't inline non-existent variables if (!enviroment.containsKey(variableName)) { throw new UnsupportedOperationException( - "Attempted to inline non-existant variable " - + variableName); + "Attempted to inline non-existant variable " + variableName); } // Return the tree for the variable @@ -77,37 +74,32 @@ public class DiceASTInliner { * Inline the specified variables in the AST * * @param ast - * The AST to inline variables into + * The AST to inline variables into * @param enviroment - * The enviroment to inline from + * The enviroment to inline from * @param variables - * The variables to inline + * The variables to inline * @return The inlined AST */ - public static ITree selectiveInline( - ITree ast, - IMap> enviroment, - IList variables) { + public static ITree selectiveInline(ITree ast, + IMap> enviroment, IList variables) { // Inline the specified variables - return selectiveInline(ast, enviroment, - variables.toArray(new String[0])); + return selectiveInline(ast, enviroment, variables.toArray(new String[0])); } /** * Inline the specified variables in the AST * * @param ast - * The AST to inline variables into + * The AST to inline variables into * @param enviroment - * The enviroment to inline from + * The enviroment to inline from * @param variables - * The variables to inline + * The variables to inline * @return The inlined AST */ - public static ITree selectiveInline( - ITree ast, - IMap> enviroment, - String... variables) { + public static ITree selectiveInline(ITree ast, + IMap> enviroment, String... variables) { // If we're selectively inlining, do so if (variables != null && variables.length > 0) { IList variableNames = new FunctionalList<>(variables); -- cgit v1.2.3