diff --git a/ZenScript/src/main/java/stanhebben/zenscript/type/expand/ZenExpandMember.java b/ZenScript/src/main/java/stanhebben/zenscript/type/expand/ZenExpandMember.java index 1d8daf3..2c440e6 100644 --- a/ZenScript/src/main/java/stanhebben/zenscript/type/expand/ZenExpandMember.java +++ b/ZenScript/src/main/java/stanhebben/zenscript/type/expand/ZenExpandMember.java @@ -158,7 +158,7 @@ public class ZenExpandMember { @Override public Expression call(ZenPosition position, IEnvironmentMethod environment, Expression... values) { IJavaMethod method = JavaMethod.select(true, methods, environment, values); - if (method == null ) { + if (method == null) { environment.error(position, methodMatchingError(methods, values)); return new ExpressionInvalid(position); } else { diff --git a/ZenScript/src/main/java/stanhebben/zenscript/util/StringUtil.java b/ZenScript/src/main/java/stanhebben/zenscript/util/StringUtil.java index 97bf61b..506e6af 100644 --- a/ZenScript/src/main/java/stanhebben/zenscript/util/StringUtil.java +++ b/ZenScript/src/main/java/stanhebben/zenscript/util/StringUtil.java @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.List; /** + * * @author Stanneke */ public class StringUtil { @@ -51,7 +52,7 @@ public class StringUtil { * If a set of methods is available and none matches, this method creates a * suitable message. * - * @param methods matching methods + * @param methods matching methods * @param arguments calling arguments * @return return value */ @@ -83,7 +84,7 @@ public class StringUtil { /** * Splits a string in parts, given a specified delimiter. * - * @param value string to be split + * @param value string to be split * @param delimiter delimiter * @return */ @@ -93,8 +94,7 @@ public class StringUtil { ArrayList result = new ArrayList(); int start = 0; - outer: - for (int i = 0; i < value.length(); i++) { + outer: for (int i = 0; i < value.length(); i++) { if (value.charAt(i) == delimiter) { result.add(value.substring(start, i)); start = i + 1; @@ -139,49 +139,50 @@ public class StringUtil { // ######################## /** + * * unescape_perl_string() - *

+ * * Tom Christiansen Sun Nov 28 12:55:24 MST 2010 - *

+ * * It's completely ridiculous that there's no standard unescape_java_string * function. Since I have to do the damn thing myself, I might as well make * it halfway useful by supporting things Java was too stupid to consider in * strings: - *

+ * * => "?" items are additions to Java string escapes but normal in Java * regexes - *

+ * * => "!" items are also additions to Java regex escapes - *

+ * * Standard singletons: ?\a ?\e \f \n \r \t - *

+ * * NB: \b is unsupported as backspace so it can pass-through to the regex * translator untouched; I refuse to make anyone doublebackslash it as * doublebackslashing is a Java idiocy I desperately wish would die out. * There are plenty of other ways to write it: - *

+ * * \cH, \12, \012, \x08 \x{8}, \u0008, \U00000008 - *

+ * * Octal escapes: \0 \0N \0NN \N \NN \NNN Can range up to !\777 not \377 - *

+ * * TODO: add !\o{NNNNN} last Unicode is 4177777 maxint is 37777777777 - *

+ * * Control chars: ?\cX Means: ord(X) ^ ord('@') - *

+ * * Old hex escapes: \xXX unbraced must be 2 xdigits - *

+ * * Perl hex escapes: !\x{XXX} braced may be 1-8 xdigits NB: proper Unicode * never needs more than 6, as highest valid codepoint is 0x10FFFF, not * maxint 0xFFFFFFFF - *

+ * * Lame Java escape: \[IDIOT JAVA PREPROCESSOR]uXXXX must be exactly 4 * xdigits; - *

+ * * I can't write XXXX in this comment where it belongs because the damned * Java Preprocessor can't mind its own business. Idiots! - *

+ * * Lame Python escape: !\UXXXXXXXX must be exactly 8 xdigits - *

+ * * TODO: Perl translation escapes: \Q \U \L \E \[IDIOT JAVA PREPROCESSOR]u * \l These are not so important to cover if you're passing the result to * Pattern.compile(), since it handles them for you further downstream. Hm, @@ -200,7 +201,7 @@ public class StringUtil { oldstr = oldstr.substring(1, oldstr.length() - 1); /* - * In contrast to fixing Java's broken regex charclasses, this one need + * In contrast to fixing Java's broken regex charclasses, this one need * be no bigger, as unescaping shrinks the string here, where in the * other one, it grows it. */ @@ -264,10 +265,10 @@ public class StringUtil { break; /* switch */ /* - * A "control" character is what you get when you xor its + * A "control" character is what you get when you xor its * codepoint with '@'==64. This only makes sense for ASCII, and * may not yield a "control" character after all. - * + * * Strange but true: "\c{" is ";", "\c}" is "=", etc. */ case 'c': {