|
@@ -388,6 +388,8 @@ class StringTools {
|
|
return (untyped s).charCodeAt(index);
|
|
return (untyped s).charCodeAt(index);
|
|
#elseif python
|
|
#elseif python
|
|
return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
|
return if (index >= s.length) -1 else python.internal.UBuiltins.ord(python.Syntax.arrayAccess(s, index));
|
|
|
|
+ #elseif hl
|
|
|
|
+ return @:privateAccess s.bytes.getUI16(index << 1);
|
|
#else
|
|
#else
|
|
return untyped s.cca(index);
|
|
return untyped s.cca(index);
|
|
#end
|
|
#end
|
|
@@ -397,7 +399,7 @@ class StringTools {
|
|
Tells if `c` represents the end-of-file (EOF) character.
|
|
Tells if `c` represents the end-of-file (EOF) character.
|
|
*/
|
|
*/
|
|
@:noUsing public static inline function isEof( c : Int ) : Bool {
|
|
@:noUsing public static inline function isEof( c : Int ) : Bool {
|
|
- #if (flash || cpp)
|
|
|
|
|
|
+ #if (flash || cpp || hl)
|
|
return c == 0;
|
|
return c == 0;
|
|
#elseif js
|
|
#elseif js
|
|
return c != c; // fast NaN
|
|
return c != c; // fast NaN
|
|
@@ -455,7 +457,7 @@ class StringTools {
|
|
public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String {
|
|
public static function quoteWinArg(argument:String, escapeMetaCharacters:Bool):String {
|
|
// If there is no space, tab, back-slash, or double-quotes, and it is not an empty string.
|
|
// If there is no space, tab, back-slash, or double-quotes, and it is not an empty string.
|
|
if (!~/^[^ \t\\"]+$/.match(argument)) {
|
|
if (!~/^[^ \t\\"]+$/.match(argument)) {
|
|
-
|
|
|
|
|
|
+
|
|
// Based on cpython's subprocess.list2cmdline().
|
|
// Based on cpython's subprocess.list2cmdline().
|
|
// https://hg.python.org/cpython/file/50741316dd3a/Lib/subprocess.py#l620
|
|
// https://hg.python.org/cpython/file/50741316dd3a/Lib/subprocess.py#l620
|
|
|
|
|