diff options
| author | EVE <EVE@EVE-PC> | 2017-03-13 16:41:45 -0400 |
|---|---|---|
| committer | EVE <EVE@EVE-PC> | 2017-03-13 16:41:45 -0400 |
| commit | 01136c6796e21f023713e026674576d8e623462d (patch) | |
| tree | e77886fe0e0adaf3c0430fba9ce248ef83f74fe4 /dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java | |
| parent | 870d769cfc152171d27b2331a7c590d0b307ad48 (diff) | |
Formatting
Diffstat (limited to 'dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java')
| -rw-r--r-- | dice-lang/src/bjc/dicelang/v1/ast/DiceASTInliner.java | 42 |
1 files changed, 17 insertions, 25 deletions
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<IDiceASTNode> inlineAll(ITree<IDiceASTNode> ast, @@ -32,8 +32,7 @@ public class DiceASTInliner { return selectiveInline(ast, enviroment, (String[]) null); } - private static ITree<IDiceASTNode> inlineNode(IDiceASTNode node, - IMap<String, ITree<IDiceASTNode>> enviroment, + private static ITree<IDiceASTNode> inlineNode(IDiceASTNode node, IMap<String, ITree<IDiceASTNode>> enviroment, boolean specificInline, IList<String> 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<IDiceASTNode> selectiveInline( - ITree<IDiceASTNode> ast, - IMap<String, ITree<IDiceASTNode>> enviroment, - IList<String> variables) { + public static ITree<IDiceASTNode> selectiveInline(ITree<IDiceASTNode> ast, + IMap<String, ITree<IDiceASTNode>> enviroment, IList<String> 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<IDiceASTNode> selectiveInline( - ITree<IDiceASTNode> ast, - IMap<String, ITree<IDiceASTNode>> enviroment, - String... variables) { + public static ITree<IDiceASTNode> selectiveInline(ITree<IDiceASTNode> ast, + IMap<String, ITree<IDiceASTNode>> enviroment, String... variables) { // If we're selectively inlining, do so if (variables != null && variables.length > 0) { IList<String> variableNames = new FunctionalList<>(variables); |
