Пример #1
0
        public static string normalize(string path)
        {
            unchecked {
                                #line 211 "/opt/haxe/std/haxe/io/Path.hx"
                string slash = "/";
                path = global::haxe.lang.StringExt.split(path, "\\").@join(slash);
                                #line 213 "/opt/haxe/std/haxe/io/Path.hx"
                if ((path == slash))
                {
                                        #line 214 "/opt/haxe/std/haxe/io/Path.hx"
                    return(slash);
                }

                                #line 216 "/opt/haxe/std/haxe/io/Path.hx"
                global::Array <string> target = new global::Array <string>(new string[] {});
                                #line 218 "/opt/haxe/std/haxe/io/Path.hx"
                {
                                        #line 218 "/opt/haxe/std/haxe/io/Path.hx"
                    int _g = 0;
                                        #line 218 "/opt/haxe/std/haxe/io/Path.hx"
                    global::Array <string> _g1 = global::haxe.lang.StringExt.split(path, slash);
                                        #line 218 "/opt/haxe/std/haxe/io/Path.hx"
                    while ((_g < _g1.length))
                    {
                                                #line 218 "/opt/haxe/std/haxe/io/Path.hx"
                        string token = _g1[_g];
                                                #line 218 "/opt/haxe/std/haxe/io/Path.hx"
                        ++_g;
                        if ((((token == "..") && (target.length > 0)) && (target[(target.length - 1)] != "..")))
                        {
                                                        #line 220 "/opt/haxe/std/haxe/io/Path.hx"
                            string __temp_expr1 = global::haxe.lang.Runtime.toString((target.pop()).toDynamic());
                        }
                        else if ((token == ""))
                        {
                                                        #line 222 "/opt/haxe/std/haxe/io/Path.hx"
                            if (((target.length > 0) || global::haxe.lang.Runtime.eq((global::haxe.lang.StringExt.charCodeAt(path, 0)).toDynamic(), 47)))
                            {
                                                                #line 223 "/opt/haxe/std/haxe/io/Path.hx"
                                target.push(token);
                            }
                        }
                        else if ((token != "."))
                        {
                                                        #line 226 "/opt/haxe/std/haxe/io/Path.hx"
                            target.push(token);
                        }
                    }
                }

                                #line 230 "/opt/haxe/std/haxe/io/Path.hx"
                string            tmp = target.@join(slash);
                global::StringBuf acc = new global::StringBuf();
                                #line 232 "/opt/haxe/std/haxe/io/Path.hx"
                bool colon   = false;
                bool slashes = false;
                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                {
                                        #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                    int _g2_offset = 0;
                                        #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                    string _g2_s = tmp;
                                        #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                    while ((_g2_offset < _g2_s.Length))
                    {
                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        string s = _g2_s;
                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        int index = _g2_offset++;
                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        int c = (((((uint)(index)) < s.Length)) ? (((int)(s[index]))) : (-1));
                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        if (((c >= 55296) && (c <= 56319)))
                        {
                                                        #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                            int index1 = (index + 1);
                                                        #line 597 "/opt/haxe/std/StringTools.hx"
                            c = (((c - 55232) << 10) | (((((((uint)(index1)) < s.Length)) ? (((int)(s[index1]))) : (-1))) & 1023));
                        }

                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        int c1 = c;
                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        if ((c1 >= 65536))
                        {
                                                        #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                            ++_g2_offset;
                        }

                                                #line 235 "/opt/haxe/std/haxe/io/Path.hx"
                        int c2 = c1;
                        switch (c2)
                        {
                        case 47:
                        {
                                                                #line 244 "/opt/haxe/std/haxe/io/Path.hx"
                            if (!(colon))
                            {
                                                                        #line 245 "/opt/haxe/std/haxe/io/Path.hx"
                                slashes = true;
                            }
                            else
                            {
                                                                        #line 246 "/opt/haxe/std/haxe/io/Path.hx"
                                int i = c2;
                                                                        #line 246 "/opt/haxe/std/haxe/io/Path.hx"
                                {
                                                                                #line 247 "/opt/haxe/std/haxe/io/Path.hx"
                                    colon = false;
                                    if (slashes)
                                    {
                                                                                        #line 249 "/opt/haxe/std/haxe/io/Path.hx"
                                        acc.b.Append(((string)("/")));
                                        slashes = false;
                                    }

                                                                                #line 252 "/opt/haxe/std/haxe/io/Path.hx"
                                    acc.addChar(i);
                                }
                            }

                                                                #line 244 "/opt/haxe/std/haxe/io/Path.hx"
                            break;
                        }


                        case 58:
                        {
                                                                #line 242 "/opt/haxe/std/haxe/io/Path.hx"
                            acc.b.Append(((string)(":")));
                            colon = true;
                                                                #line 241 "/opt/haxe/std/haxe/io/Path.hx"
                            break;
                        }


                        default:
                        {
                                                                #line 246 "/opt/haxe/std/haxe/io/Path.hx"
                            int i1 = c2;
                                                                #line 246 "/opt/haxe/std/haxe/io/Path.hx"
                            {
                                                                        #line 247 "/opt/haxe/std/haxe/io/Path.hx"
                                colon = false;
                                if (slashes)
                                {
                                                                                #line 249 "/opt/haxe/std/haxe/io/Path.hx"
                                    acc.b.Append(((string)("/")));
                                    slashes = false;
                                }

                                                                        #line 252 "/opt/haxe/std/haxe/io/Path.hx"
                                acc.addChar(i1);
                            }

                                                                #line 246 "/opt/haxe/std/haxe/io/Path.hx"
                            break;
                        }
                        }
                    }
                }

                                #line 256 "/opt/haxe/std/haxe/io/Path.hx"
                return(acc.b.ToString());
            }
                        #line default
        }
Пример #2
0
        public static string buildArgumentsString(global::Array <string> args)
        {
            unchecked {
                                #line 80 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                if ((global::Sys.systemName() == "Windows"))
                {
                                        #line 82 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                    global::Array <string> _g = new global::Array <string>(new string[] {});
                    {
                                                #line 83 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                        int _g1 = 0;
                                                #line 83 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                        while ((_g1 < args.length))
                        {
                                                        #line 83 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                            string a = args[_g1];
                                                        #line 83 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                            ++_g1;
                            _g.push(global::haxe.SysTools.quoteWinArg(a, false));
                        }
                    }

                                        #line 82 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                    return(_g.@join(" "));
                }
                else
                {
                                        #line 89 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                    global::Array <string> _g2 = new global::Array <string>(new string[] {});
                    {
                                                #line 90 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                        int _g3 = 0;
                                                #line 90 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                        while ((_g3 < args.length))
                        {
                                                        #line 90 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                            string arg = args[_g3];
                                                        #line 90 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                            ++_g3;
                            global::StringBuf b = new global::StringBuf();
                                                        #line 92 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                            b.b.Append(((string)("\"")));
                            {
                                                                #line 93 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                int _g4 = 0;
                                                                #line 93 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                int _g5 = arg.Length;
                                                                #line 93 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                while ((_g4 < _g5))
                                {
                                                                        #line 93 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                    int i = _g4++;
                                    global::haxe.lang.Null <int> c = global::haxe.lang.StringExt.charCodeAt(arg, i);
                                                                        #line 95 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                    if (!(c.hasValue))
                                    {
                                    }
                                    else
                                    {
                                                                                #line 95 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                        switch (((c)).@value)
                                        {
                                        case 34:
                                        case 92:
                                        {
                                                                                                #line 97 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                            b.addChar(92);
                                                                                                #line 97 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                            break;
                                        }


                                        default:
                                        {
                                                                                                #line 98 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                            break;
                                        }
                                        }
                                    }

                                                                        #line 100 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                                    b.addChar((c).@value);
                                }
                            }

                                                        #line 102 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                            b.b.Append(((string)("\"")));
                            _g2.push(b.b.ToString());
                        }
                    }

                                        #line 89 "/opt/haxe/std/cs/_std/sys/io/Process.hx"
                    return(_g2.@join(" "));
                }
            }
                        #line default
        }
Пример #3
0
        public virtual string toString()
        {
                        #line 204 "/opt/haxe/std/haxe/ds/GenericStack.hx"
            global::Array <T> a = new global::Array <T>();
            global::haxe.ds.GenericCell <T> l = this.head;
                        #line 206 "/opt/haxe/std/haxe/ds/GenericStack.hx"
            while ((l != null))
            {
                                #line 207 "/opt/haxe/std/haxe/ds/GenericStack.hx"
                a.push(l.elt);
                l = l.next;
            }

                        #line 210 "/opt/haxe/std/haxe/ds/GenericStack.hx"
            return(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("{", a.@join(",")), "}"));
        }