Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated docs

  • Loading branch information...
commit 6d0fbec53fcc39edb8b588d7fa0b7e756c58606c 1 parent 284e124
@LadyCailin LadyCailin authored
View
10 src/main/java/com/laytonsmith/core/functions/ArrayHandling.java
@@ -1,6 +1,7 @@
package com.laytonsmith.core.functions;
import com.laytonsmith.PureUtilities.RunnableQueue;
+import com.laytonsmith.PureUtilities.StringUtils;
import com.laytonsmith.abstraction.StaticLayer;
import com.laytonsmith.annotations.api;
import com.laytonsmith.core.*;
@@ -1061,7 +1062,7 @@ public Construct exec(Target t, Environment environment, Construct... args) thro
sortType = CArray.SortType.valueOf(args[1].val().toUpperCase());
}
} catch (IllegalArgumentException e) {
- throw new ConfigRuntimeException("The sort type must be one of either: REGULAR, NUMERIC, STRING, or STRING_IC",
+ throw new ConfigRuntimeException("The sort type must be one of either: " + StringUtils.Join(CArray.SortType.values(), ", ", " or "),
ExceptionType.FormatException, t);
}
ca.sort(sortType);
@@ -1083,7 +1084,7 @@ public String docs() {
+ " is passed in as a variable, the contents of that variable will be sorted, even if you don't re-assign"
+ " the returned array back to the variable. If you really need the old array, you should create a copy of"
+ " the array first, like so: assign(@sorted, array_sort(@array[])). The sort type may be one of the following:"
- + " REGULAR, NUMERIC, STRING, STRING_IC. A regular sort sorts the elements without changing types first. A"
+ + " " + StringUtils.Join(CArray.SortType.values(), ", ", " or ") + ". A regular sort sorts the elements without changing types first. A"
+ " numeric sort always converts numeric values to numbers first (so 001 becomes 1). A string sort compares"
+ " values as strings, and a string_ic sort is the same as a string sort, but the comparision is case-insensitive."
+ " If the array contains array values, a CastException is thrown; inner arrays cannot be sorted against each"
@@ -1113,7 +1114,7 @@ public ParseTree optimizeDynamic(Target t, List<ParseTree> children) throws Conf
try {
CArray.SortType.valueOf(children.get(1).getData().val().toUpperCase());
} catch (IllegalArgumentException e) {
- throw new ConfigCompileException("The sort type must be one of either: REGULAR, NUMERIC, STRING, or STRING_CI", t);
+ throw new ConfigCompileException("The sort type must be one of either: " + StringUtils.Join(CArray.SortType.values(), ", ", " or "), t);
}
}
}
@@ -1188,7 +1189,8 @@ public String getName() {
public String docs() {
return "void {array, [sortType], closure(array)} Works like array_sort, but does the sort on another"
+ " thread, then calls the closure and sends it the sorted array. This is useful if the array"
- + " is large enough to actually \"stall\" the server when doing the sort.";
+ + " is large enough to actually \"stall\" the server when doing the sort. Sort type should be"
+ + " one of " + StringUtils.Join(CArray.SortType.values(), ", ", " or ");
}
public CHVersion since() {
View
2  src/main/java/com/laytonsmith/tools/docgen/DocGen.java
@@ -292,7 +292,7 @@ public int compare(FunctionBase o1, FunctionBase o2) {
} else if (type.equals("wiki")) {
//Turn args into a prettified version
out.append("|- id=\"" + f.getName() + "\"\n"
- + "! scope=\"row\" | [[CommandHelper/" + (staged?"Staged/":"") + "API/" + f.getName() + "|" + f.getName() + "]]\n"
+ + "! scope=\"row\" | [[CommandHelper/" + (staged?"Staged/":"") + "API/" + f.getName() + "|" + f.getName() + "]]()\n"
+ "| " + di.ret + "\n"
+ "| " + di.args + "\n"
+ "| " + thrown.toString() + "\n"
Please sign in to comment.
Something went wrong with that request. Please try again.