Skip to content

Commit e2f9546

Browse files
committed
Merge branch 'master' of github.com:sk89q/commandhelper
2 parents c4d85cc + 845ee8d commit e2f9546

File tree

8 files changed

+10
-296
lines changed

8 files changed

+10
-296
lines changed

README.html

Lines changed: 0 additions & 95 deletions
This file was deleted.

pom.xml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -465,26 +465,6 @@
465465
</configuration>
466466
</plugin>
467467

468-
<!-- Assembly -->
469-
<plugin>
470-
<artifactId>maven-assembly-plugin</artifactId>
471-
<version>2.2-beta-2</version>
472-
<configuration>
473-
<descriptor>${basedir}/src/main/assembly/default.xml</descriptor>
474-
</configuration>
475-
</plugin>
476-
477-
<!-- Release -->
478-
<plugin>
479-
<groupId>org.apache.maven.plugins</groupId>
480-
<artifactId>maven-release-plugin</artifactId>
481-
<version>2.2.2</version>
482-
<configuration>
483-
<preparationGoals>assembly:assembly</preparationGoals>
484-
<goals>assembly:assembly</goals>
485-
</configuration>
486-
</plugin>
487-
488468
<!-- Shade plugin -->
489469
<plugin>
490470
<groupId>org.apache.maven.plugins</groupId>

src/main/assembly/default.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/main/java/com/laytonsmith/core/MethodScriptCompiler.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,30 +1592,6 @@ private static void optimize(ParseTree tree, Stack<List<Procedure>> procs, Set<C
15921592
//There's no way to optimize something that's not a function
15931593
return;
15941594
}
1595-
//cc has to be inb4 other autoconcats, so sconcats on the lower level won't get run
1596-
if (tree.getData().val().equals("cc")) {
1597-
for (int i = 0; i < tree.getChildren().size(); i++) {
1598-
ParseTree node = tree.getChildAt(i);
1599-
if (node.getData().val().equals(__autoconcat__)) {
1600-
Compiler.__autoconcat__ func;
1601-
try {
1602-
func = (Compiler.__autoconcat__) FunctionList.getFunction(node.getData());
1603-
} catch (ConfigCompileException ex) {
1604-
compilerErrors.add(ex);
1605-
return;
1606-
}
1607-
try {
1608-
ParseTree tempNode = func.optimizeSpecial(node.getChildren(), false);
1609-
tree.setData(tempNode.getData());
1610-
tree.setChildren(tempNode.getChildren());
1611-
} catch (ConfigCompileException ex) {
1612-
compilerErrors.add(ex);
1613-
}
1614-
optimize(tree, procs, compilerErrors);
1615-
return;
1616-
}
1617-
}
1618-
}
16191595
//If it is a proc definition, we need to go ahead and see if we can add it to the const proc stack
16201596
if (tree.getData().val().equals("proc")) {
16211597
procs.push(new ArrayList<Procedure>());

src/main/java/com/laytonsmith/core/compiler/NewMethodScriptCompiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public static ParseTree compile(TokenStream tokenStream, Environment compilerEnv
176176

177177
private static void link(ParseTree root, Environment compilerEnvirontment) throws ConfigCompileException {
178178
//Before we actually link, we need to optimize our branch functions, that is,
179-
//currently just if. However, at this point, we also need to optimize __autoconcat__ and cc.
179+
//currently just if. However, at this point, we also need to optimize __autoconcat__.
180180
//so we know what the tree actually looks like. Also, we want to first group all our auto includes
181181
//together, along with our actual tree.
182182
ParseTree master = new ParseTree(new CFunction("__autoconcat__", Target.UNKNOWN), root.getFileOptions());

src/main/java/com/laytonsmith/core/compiler/OptimizerObject.java

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,14 @@ public ParseTree optimize() throws ConfigCompileException{
4343
private void optimize01(ParseTree tree, CompilerEnvironment compilerEnvironment) throws ConfigCompileException {
4444
com.laytonsmith.core.functions.Compiler.__autoconcat__ autoconcat
4545
= (com.laytonsmith.core.functions.Compiler.__autoconcat__) FunctionList.getFunction("__autoconcat__", Target.UNKNOWN);
46-
if (tree.getData() instanceof CFunction && tree.getData().val().equals("cc")) {
47-
for (int i = 0; i < tree.getChildren().size(); i++) {
48-
ParseTree node = tree.getChildAt(i);
49-
if (node.getData().val().equals("__autoconcat__")) {
50-
ParseTree tempNode = autoconcat.optimizeSpecial(node.getChildren(), false);
51-
tree.setData(tempNode.getData());
52-
tree.setChildren(tempNode.getChildren());
53-
optimize01(tree, compilerEnvironment);
54-
return;
55-
}
56-
}
57-
} else {
58-
if (tree.getData() instanceof CFunction && tree.getData().val().equals("__autoconcat__")) {
59-
ParseTree tempNode = autoconcat.optimizeSpecial(tree.getChildren(), true);
60-
tree.setData(tempNode.getData());
61-
tree.setChildren(tempNode.getChildren());
62-
}
63-
for (int i = 0; i < tree.getChildren().size(); i++) {
64-
ParseTree node = tree.getChildren().get(i);
65-
optimize01(node, compilerEnvironment);
66-
}
46+
if (tree.getData() instanceof CFunction && tree.getData().val().equals("__autoconcat__")) {
47+
ParseTree tempNode = autoconcat.optimizeSpecial(tree.getChildren(), true);
48+
tree.setData(tempNode.getData());
49+
tree.setChildren(tempNode.getChildren());
50+
}
51+
for (int i = 0; i < tree.getChildren().size(); i++) {
52+
ParseTree node = tree.getChildren().get(i);
53+
optimize01(node, compilerEnvironment);
6754
}
6855
}
6956

src/main/java/com/laytonsmith/core/functions/StringHandling.java

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -59,107 +59,6 @@ public static String docs() {
5959
return "These class provides functions that allow strings to be manipulated";
6060
}
6161

62-
@api
63-
@hide("Overly complicated, and just not worth having. This is deprecated, and will be removed in a future release")
64-
public static class cc extends AbstractFunction implements Optimizable {
65-
66-
@Override
67-
public String getName() {
68-
return "cc";
69-
}
70-
71-
@Override
72-
public Integer[] numArgs() {
73-
return new Integer[]{Integer.MAX_VALUE};
74-
}
75-
76-
@Override
77-
public String docs() {
78-
return "string {args...} The cousin to <strong>c</strong>on<strong>c</strong>at, this function does some magic under the covers"
79-
+ " to remove the auto-concatenation effect in bare strings. Take the following example: cc(bare string) -> barestring";
80-
}
81-
82-
@Override
83-
public ExceptionType[] thrown() {
84-
return null;
85-
}
86-
87-
@Override
88-
public boolean isRestricted() {
89-
return false;
90-
}
91-
92-
@Override
93-
public boolean preResolveVariables() {
94-
return false;
95-
}
96-
97-
@Override
98-
public CHVersion since() {
99-
return CHVersion.V3_3_1;
100-
}
101-
102-
@Override
103-
public Boolean runAsync() {
104-
return null;
105-
}
106-
107-
@Override
108-
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException {
109-
return CVoid.VOID;
110-
}
111-
112-
@Override
113-
public Construct execs(Target t, Environment env, Script parent, ParseTree... nodes) {
114-
//if any of the nodes are sconcat, move their children up a level
115-
List<ParseTree> list = new ArrayList<ParseTree>();
116-
for (ParseTree node : nodes) {
117-
if (node.getData().val().equals("sconcat")) {
118-
for (ParseTree sub : node.getChildren()) {
119-
list.add(sub);
120-
}
121-
} else {
122-
list.add(node);
123-
}
124-
}
125-
126-
StringBuilder b = new StringBuilder();
127-
for (ParseTree node : list) {
128-
Construct c = parent.seval(node, env);
129-
b.append(c.val());
130-
}
131-
return new CString(b.toString(), t);
132-
}
133-
134-
@Override
135-
public boolean useSpecialExec() {
136-
return true;
137-
}
138-
139-
public ParseTree optimizeSpecial(Target target, List<ParseTree> children) {
140-
throw new UnsupportedOperationException("Not yet implemented");
141-
}
142-
143-
@Override
144-
public ExampleScript[] examples() throws ConfigCompileException {
145-
return new ExampleScript[]{
146-
new ExampleScript("", "cc('These' 'normally' 'have' 'spaces' 'between' 'them')"),};
147-
}
148-
149-
@Override
150-
public Set<OptimizationOption> optimizationOptions() {
151-
return EnumSet.of(OptimizationOption.OPTIMIZE_DYNAMIC);
152-
}
153-
154-
@Override
155-
public ParseTree optimizeDynamic(Target t, List<ParseTree> children, FileOptions fileOptions) throws ConfigCompileException, ConfigRuntimeException {
156-
CHLog.GetLogger().w(CHLog.Tags.DEPRECATION, getName() + " has been deprecated, and will be removed in a future release."
157-
+ " Please use dot concatenation where necessary, to achieve the same effect.", t);
158-
return null;
159-
}
160-
161-
}
162-
16362
@api
16463
public static class concat extends AbstractFunction implements Optimizable {
16564

src/test/java/com/laytonsmith/testing/ProcedureTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void setUp() {
5050
}
5151

5252
@Test public void ensureOutOfScopeWorks() throws Exception{
53-
SRun("assign(@lol, '42') proc(_blah, msg(cc('notlol' @lol))) _blah()", fakePlayer);
53+
SRun("assign(@lol, '42') proc(_blah, msg('notlol'.@lol)) _blah()", fakePlayer);
5454
verify(fakePlayer).sendMessage("notlolnull");
5555
}
5656

0 commit comments

Comments
 (0)