Changeset 390

Show
Ignore:
Timestamp:
10/10/08 14:10:05 (2 months ago)
Author:
JarrettBillingsley
Message:

Fixed allFieldsOf for I swear, the second or third time. How does it keep breaking?

MDCL now prints traceback info.

Added the registry, which is pretty much the same as the Lua registry (a "secret" global namespace usable by native code).

Fixed a bug in string.split where it was splitting in individual characters instead of the entire split string.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/v2new/itertools.md

    r271 r390  
    3030{ 
    3131    if(#vararg == 0) 
    32         return function() = null 
     32        return \-> null 
    3333 
    3434    local args = [vararg] 
    3535    local n = #args 
    36     local lengths = args.map(function(x) = #x) 
     36    local lengths = args.map(\x -> #x) 
    3737    local temp = array.new(n) 
    3838 
     
    4444        { 
    4545            if(index >= lengths[i]) 
    46                 return; 
     46                return 
    4747 
    4848            temp[i] = args[i][index] 
    4949        } 
    50          
     50 
    5151        return index, temp.expand() 
    5252    } 
    53      
     53 
    5454    return iterator, null, -1 
    5555} 
     
    6565        { 
    6666            if(idx0 is null) 
    67                 return; 
     67                return 
    6868 
    6969            yield(idx0, vararg) 
     
    8585 
    8686            if(index >= times) 
    87                 return; 
     87                return 
    8888 
    8989            return index, x 
     
    9898    { 
    9999        index++ 
    100          
     100 
    101101        local ret = callable() 
    102102 
    103103        if(ret is sentinel) 
    104             return; 
     104            return 
    105105 
    106106        return index, ret 
     
    112112function imap(func, vararg) 
    113113{ 
    114     local iterables = [vararg].apply(generator).each(function(i, v) v()) 
     114    local iterables = [vararg].apply(generator).each(\i, v -> v()) 
    115115    local args = array.new(#iterables) 
    116116 
     
    124124 
    125125            if(iterables[i].isDead()) 
    126                 return; 
     126                return 
    127127        } 
    128128 
  • branches/v2new/minid/baselib.d

    r383 r390  
    266266     
    267267                    setUpval(t, 0); 
    268                     pushInt(t, -1); 
     268                    pushInt(t, 0); 
    269269                    setUpval(t, 1); 
    270270                    pop(t, 2); 
  • branches/v2new/minid/bind.d

    r379 r390  
    9292        else static if(is(typeof(member.isStruct))) 
    9393        { 
    94  
    95  
    96             dchar[] name = utf.toUtf32(member.Name); 
    97             ns[name] = MDValue(new member.Class()); 
    98         } 
    99         else 
     94            member.init(t); 
     95            fielda(t, -2, member.Name); 
     96        } 
     97        else static if(isModule) 
    10098            static assert(false, "Invalid member type '" ~ member.stringof ~ "' in wrapped module '" ~ name ~ "'"); 
     99        else 
     100            static assert(false, "Invalid member type '" ~ member.stringof ~ "' in wrapped namespace '" ~ name ~ "'"); 
    101101    } 
    102102} 
     
    191191                    static if(is(ReturnTypeOf!(funcType) == void)) 
    192192                    { 
    193                         func(); 
     193                        safeCode(t, func()); 
    194194                        return 0; 
    195195                    } 
    196196                    else 
    197197                    { 
    198                         superPush(t, func()); 
     198                        superPush(t, safeCode(t, func())); 
    199199                        return 1; 
    200200                    } 
    201201                } 
    202202            } 
    203      
     203 
    204204            foreach(i, arg; args) 
    205205            { 
    206206                const argNum = i + 1; 
    207      
     207 
    208208                if(i < numParams) 
    209209                    getParameter(t, argNum, args[i]); 
     
    215215                        static if(is(ReturnTypeOf!(funcType) == void)) 
    216216                        { 
    217                             safeCode(t, func(args[0 .. argNum])); 
     217                            safeCode(t, safeCode(t, func(args[0 .. argNum]))); 
    218218                            return 0; 
    219219                        } 
     
    599599                ns[k] = v; 
    600600            } 
    601      
     601 
    602602            return 0; 
    603603        } 
    604604    } 
    605      
     605 
    606606    private Loader* loader; 
    607607 
    608608    /** 
    609609    Creates an instance of this struct so you can start wrapping a module. 
    610      
     610 
    611611    Params: 
    612612        name = The name of the module to expose to MiniD.  This can be a multi-part name, with dots (like "foo.bar"). 
    613613        context = The MiniD context to load this module into. 
    614          
     614 
    615615    Returns: 
    616616        An instance of this struct ready to have members added. 
     
    632632    /** 
    633633    Wrap a function and insert it into this module's namespace.  This must be a non-member D function. 
    634      
     634 
    635635    Params: 
    636636        f = An alias to the function you want to wrap. 
     
    638638        funcType = The type of the function to wrap.  This defaults to typeof(f), but you'll need to specify this 
    639639            explicitly if you're wrapping an overloaded function, in order to select the proper overload. 
    640              
     640 
    641641    Returns: 
    642642        A chaining reference to this module. 
     
    656656        const name32 = ToUTF32!(name); 
    657657        loader.namespace[name32] = MDValue(new MDClosure(loader.namespace, &WrappedFunc!(f, name, funcType), name32)); 
    658          
     658 
    659659        return this; 
    660660    } 
  • branches/v2new/minid/commandline.d

    r389 r390  
    219219            word reg; 
    220220 
    221             if(!inputFile.endsWith(".md") && !inputFile.endsWith(".mdm")) 
    222                 reg = importModule(t, inputFile); 
    223             else 
    224             { 
    225                 if(inputFile.endsWith(".md")) 
    226                 { 
    227                     scope c = new Compiler(t); 
    228                     c.compileModule(inputFile); 
    229                 } 
     221            try 
     222            { 
     223                if(!inputFile.endsWith(".md") && !inputFile.endsWith(".mdm")) 
     224                    reg = importModule(t, inputFile); 
    230225                else 
    231226                { 
    232                     scope fc = new FileConduit(inputFile, FileConduit.ReadExisting); 
    233                     scope r = new Reader(fc); 
    234                     deserializeModule(t, r); 
    235                 } 
    236  
    237                 lookup(t, "modules.initModule"); 
    238                 swap(t); 
     227                    if(inputFile.endsWith(".md")) 
     228                    { 
     229                        scope c = new Compiler(t); 
     230                        c.compileModule(inputFile); 
     231                    } 
     232                    else 
     233                    { 
     234                        scope fc = new FileConduit(inputFile, FileConduit.ReadExisting); 
     235                        scope r = new Reader(fc); 
     236                        deserializeModule(t, r); 
     237                    } 
     238 
     239                    lookup(t, "modules.initModule"); 
     240                    swap(t); 
     241                    pushNull(t); 
     242                    swap(t); 
     243                    pushString(t, funcName(t, -1)); 
     244                    rawCall(t, -4, 1); 
     245                    reg = stackSize(t) - 1; 
     246                } 
     247 
    239248                pushNull(t); 
    240                 swap(t); 
    241                 pushString(t, funcName(t, -1)); 
    242                 rawCall(t, -4, 1); 
    243                 reg = stackSize(t) - 1; 
    244             } 
    245  
    246             pushNull(t); 
    247             lookup(t, "modules.runMain"); 
    248             swap(t, -3); 
    249  
    250             foreach(a; args) 
    251                 pushString(t, a); 
    252  
    253             rawCall(t, reg, 0); 
     249                lookup(t, "modules.runMain"); 
     250                swap(t, -3); 
     251 
     252                foreach(a; args) 
     253                    pushString(t, a); 
     254 
     255                rawCall(t, reg, 0); 
     256            } 
     257            catch(MDException e) 
     258            { 
     259                catchException(t); 
     260                pop(t); 
     261 
     262                mOutput.formatln("Error: {}", e); 
     263 
     264                auto tb = getTraceback(t); 
     265                mOutput.formatln("{}", getString(t, tb)); 
     266                pop(t); 
     267                mOutput.newline; 
     268            } 
    254269        } 
    255270 
     
    407422 
    408423                    mOutput.formatln("Error: {}", e); 
    409 //                  mOutput.formatln("{}", ctx.getTracebackString()); 
     424                     
     425                    auto tb = getTraceback(t); 
     426                    mOutput.formatln("{}", getString(t, tb)); 
     427                    pop(t); 
    410428                    mOutput.newline; 
    411429                } 
  • branches/v2new/minid/ex.d

    r389 r390  
    529529} 
    530530 
     531/** 
     532Pushes the variable that is stored in the registry with the given name onto the stack.  An error will be thrown if the variable 
     533does not exist in the registry. 
     534 
     535Returns: 
     536    The stack index of the newly-pushed value. 
     537*/ 
     538public word getRegistryVar(MDThread* t, char[] name) 
     539{ 
     540    pushRegistry(t); 
     541    field(t, -1, name); 
     542    insertAndPop(t, -2); 
     543    return stackSize(t) - 1; 
     544} 
     545 
     546/** 
     547Pops the value off the top of the stack and sets it into the given registry variable. 
     548*/ 
     549public void setRegistryVar(MDThread* t, char[] name) 
     550{ 
     551    pushRegistry(t); 
     552    swap(t); 
     553    fielda(t, -2, name); 
     554    pop(t); 
     555} 
     556 
    531557// ================================================================================================================================================ 
    532558// Private 
  • branches/v2new/minid/gc.d

    r387 r390  
    5252    foreach(s; vm.metaStrings) 
    5353        markObj(vm, s); 
    54          
     54 
    5555    foreach(ref l; vm.traceback) 
    5656        markObj(vm, l.file); 
     
    5858    markObj(vm, vm.globals); 
    5959    markObj(vm, vm.mainThread); 
     60    markObj(vm, vm.registry); 
    6061     
    6162    if(vm.isThrowing) 
  • branches/v2new/minid/interpreter.d

    r389 r390  
    31823182Params: 
    31833183    idx = The stack index of the weak reference object to dereference. 
    3184      
     3184 
    31853185Returns: 
    31863186    The stack index of the newly-pushed value. 
     
    33783378        return 0; 
    33793379    } 
     3380} 
     3381 
     3382/** 
     3383Pushes the VM's registry namespace onto the stack.  The registry is sort of a hidden global namespace only accessible 
     3384from native code and which native code may use for any purpose. 
     3385 
     3386Returns: 
     3387    The stack index of the newly-pushed namespace. 
     3388*/ 
     3389word pushRegistry(MDThread* t) 
     3390{ 
     3391    return pushNamespace(t, t.vm.registry); 
    33803392} 
    33813393 
  • branches/v2new/minid/iolib.d

    r379 r390  
    397397            checkObjParam(t, 0, "InputStream"); 
    398398            pushExtraVal(t, 0, Members.reader); 
    399             auto ret = cast(Reader)getNativeObj(t, -1); 
     399            auto ret = cast(Reader)cast(void*)getNativeObj(t, -1); 
    400400            pop(t); 
    401401            return ret; 
     
    406406            checkObjParam(t, 0, "InputStream"); 
    407407            pushExtraVal(t, 0, Members.lines); 
    408             auto ret = cast(LineIterator!(char))getNativeObj(t, -1); 
     408            auto ret = cast(LineIterator!(char))cast(void*)getNativeObj(t, -1); 
    409409            pop(t); 
    410410            return ret; 
     
    586586            checkObjParam(t, 0, "OutputStream"); 
    587587            pushExtraVal(t, 0, Members.writer); 
    588             auto ret = cast(Writer)getNativeObj(t, -1); 
     588            auto ret = cast(Writer)cast(void*)getNativeObj(t, -1); 
    589589            pop(t); 
    590590            return ret; 
     
    595595            checkObjParam(t, 0, "OutputStream"); 
    596596            pushExtraVal(t, 0, Members.print); 
    597             auto ret = cast(Print!(char))getNativeObj(t, -1); 
     597            auto ret = cast(Print!(char))cast(void*)getNativeObj(t, -1); 
    598598            pop(t); 
    599599            return ret; 
     
    604604            checkObjParam(t, 0, "OutputStream"); 
    605605            pushExtraVal(t, 0, Members.output); 
    606             auto ret = cast(OutputStream)getNativeObj(t, -1); 
     606            auto ret = cast(OutputStream)cast(void*)getNativeObj(t, -1); 
    607607            pop(t); 
    608608            return ret; 
     
    740740                pop(t); 
    741741                pushExtraVal(t, 1, InputStreamObj.Members.input); 
    742                 stream = cast(InputStream)getNativeObj(t, -1); 
     742                stream = cast(InputStream)cast(void*)getNativeObj(t, -1); 
    743743                pop(t); 
    744744            } 
     
    753753                    pushExtraVal(t, 1, StreamObj.Members.input); 
    754754                    pushExtraVal(t, -1, InputStreamObj.Members.input); 
    755                     stream = cast(InputStream)getNativeObj(t, -1); 
     755                    stream = cast(InputStream)cast(void*)getNativeObj(t, -1); 
    756756                    pop(t, 2); 
    757757                } 
     
    886886                throwException(t, "Stream is not seekable."); 
    887887 
    888             auto ret = cast(IConduit.Seek)getNativeObj(t, -1); 
     888            auto ret = cast(IConduit.Seek)cast(void*)getNativeObj(t, -1); 
    889889            pop(t); 
    890890            return ret; 
    891891        } 
    892          
     892 
    893893        IConduit getConduit(MDThread* t) 
    894894        { 
    895895            checkObjParam(t, 0, "Stream"); 
    896896            pushExtraVal(t, 0, Members.conduit); 
    897             auto ret = cast(IConduit)getNativeObj(t, -1); 
     897            auto ret = cast(IConduit)cast(void*)getNativeObj(t, -1); 
    898898            pop(t); 
    899899            return ret; 
     
    10521052            pushExtraVal(t, 0, Members.input); 
    10531053            pushExtraVal(t, -1, InputStreamObj.Members.input); 
    1054             (cast(InputStream)getNativeObj(t, -1)).clear(); 
     1054            (cast(InputStream)cast(void*)getNativeObj(t, -1)).clear(); 
    10551055 
    10561056            return 0; 
     
    10711071                pushExtraVal(t, 0, Members.input); 
    10721072                pushExtraVal(t, -1, InputStreamObj.Members.input); 
    1073                 (cast(InputStream)getNativeObj(t, -1)).clear(); 
     1073                (cast(InputStream)cast(void*)getNativeObj(t, -1)).clear(); 
    10741074                return 0; 
    10751075            } 
     
    10921092            pushOutput(t); 
    10931093            pushExtraVal(t, -1, OutputStreamObj.Members.output); 
    1094             try (cast(OutputStream)getNativeObj(t, -1)).flush(); catch{} 
     1094            try (cast(OutputStream)cast(void*)getNativeObj(t, -1)).flush(); catch{} 
    10951095            getConduit(t).close(); 
    10961096            return 0; 
  • branches/v2new/minid/moduleslib.d

    r380 r390  
    4040    public void init(MDThread* t) 
    4141    { 
     42        newTable(t); setRegistryVar(t, "modules.loading"); 
     43 
    4244        auto ns = newNamespace(t, "modules"); 
    4345            pushString(t, "."); fielda(t, ns, "path"); 
    44             newTable(t);        fielda(t, ns, "loading"); 
    4546            newTable(t);        fielda(t, ns, "customLoaders"); 
    4647            dup(t, ns); newFunctionWithEnv(t, &load,       "load");       fielda(t, ns, "load"); 
     
    5758 
    5859            pushString(t, "loaders"); 
    59                 dup(t, ns); newFunctionWithEnv(t, &checkCircular, "checkCircular"); 
    6060                dup(t, ns); newFunctionWithEnv(t, &customLoad,    "customLoad"); 
    6161                dup(t, ns); newFunctionWithEnv(t, &checkTaken,    "checkTaken"); 
    6262                dup(t, ns); newFunctionWithEnv(t, &loadFiles,     "loadFiles"); 
    63      
     63 
    6464                version(MDDynLibs) 
    6565                { 
    6666                    dup(t, ns); newFunctionWithEnv(t, &loadDynlib, "loadDynlib"); 
    67                     newArrayFromStack(t, 5); 
     67                    newArrayFromStack(t, 4); 
    6868                } 
    6969                else 
    70                     newArrayFromStack(t, 4); 
     70                    newArrayFromStack(t, 3); 
    7171            fielda(t, ns); 
    7272        newGlobal(t, "modules"); 
    7373    } 
    74      
     74 
    7575    package uword load(MDThread* t, uword numParams) 
    7676    { 
     
    102102        return commonLoad(t, name); 
    103103    } 
    104      
     104 
    105105    package uword commonLoad(MDThread* t, char[] name) 
    106106    { 
     107        checkCircular(t, name); 
     108         
     109        scope(exit) 
     110        { 
     111            getRegistryVar(t, "modules.loading"); 
     112            pushNull(t); 
     113            fielda(t, -2, name); 
     114            pop(t);  
     115        } 
     116 
    107117        auto loaders = pushGlobal(t, "loaders"); 
    108118        auto num = len(t, -1); 
    109      
     119 
    110120        for(uword i = 0; i < num; i++) 
    111121        { 
     
    115125            pushString(t, name); 
    116126            rawCall(t, reg, 1); 
    117              
     127 
    118128            if(isFunction(t, -1)) 
    119129            { 
     
    148158        assert(false); 
    149159    } 
    150      
     160 
    151161    package uword initModule(MDThread* t, uword numParams) 
    152162    { 
     
    220230    } 
    221231 
    222     package uword checkCircular(MDThread* t, uword numParams) 
    223     { 
    224         checkStringParam(t, 1); 
    225         pushGlobal(t, "loading"); 
    226         dup(t, 1); 
    227         idx(t, -2); 
    228      
    229         if(!isNull(t, -1)) 
    230             throwException(t, "Attempting to import module \"{}\" while it's in the process of being imported; is it being circularly imported?", getString(t, 1)); 
    231      
    232         return 0; 
    233     } 
    234      
    235232    package uword customLoad(MDThread* t, uword numParams) 
    236233    { 
     
    239236        dup(t, 1); 
    240237        idx(t, -2); 
    241          
     238 
    242239        if(isFunction(t, -1) || isNamespace(t, -1)) 
    243240            return 1; 
     
    245242        return 0; 
    246243    } 
    247      
     244 
    248245    package uword checkTaken(MDThread* t, uword numParams) 
    249246    { 
     
    350347        return 0; 
    351348    } 
     349     
     350    private void checkCircular(MDThread* t, char[] name) 
     351    { 
     352        getRegistryVar(t, "modules.loading"); 
     353        field(t, -1, name); 
     354 
     355        if(!isNull(t, -1)) 
     356            throwException(t, "Attempting to import module \"{}\" while it's in the process of being imported; is it being circularly imported?", name); 
     357 
     358        pop(t); 
     359        pushBool(t, true); 
     360        fielda(t, -2, name); 
     361        pop(t); 
     362    } 
     363 
    352364} 
  • branches/v2new/minid/stringlib.d

    r389 r390  
    371371        if(numParams > 0) 
    372372        { 
    373             foreach(piece; src.delimiters(checkStringParam(t, 1))) 
     373            foreach(piece; src.patterns(checkStringParam(t, 1))) 
    374374            { 
    375375                pushString(t, piece); 
  • branches/v2new/minid/types.d

    r387 r390  
    705705    package MDThread* curThread; 
    706706    package Hash!(MDBaseObject*, MDWeakRef*) weakRefTab; 
     707    package MDNamespace* registry; 
    707708 
    708709    // The following members point into the D heap. 
  • branches/v2new/minid/vm.d

    r379 r390  
    8787    vm.curThread = vm.mainThread; 
    8888    vm.globals = namespace.create(vm.alloc, string.create(vm, "")); 
     89    vm.registry = namespace.create(vm.alloc, string.create(vm, "<registry>")); 
    8990    vm.formatter = new Layout!(char)(); 
    9091 
  • branches/v2new/samples/simple.md

    r387 r390  
    11module samples.simple 
    22 
    3 function freep(x: int) 
    4 
    5     if(x == 0) 
    6         throw "hi" 
    7          
    8     return freep(x - 1
    9 
    10  
    11 freep(5) 
    12  
    13 /+ 
    14 function Enum(name: string, vararg) 
    15 
    16  
    17 
    18  
    19 namespace NodeType 
    20 
    21     Add = 0 
    22     Mul = 1 
    23     Var = 2 
    24     Num = 3 
    25 
     3 
     4 
     5/* 
     6function enum(name: string, vararg) 
     7
     8    local sb = StringBuffer.clone(
     9 
     10    sb.append("namespace ", name, "\n{\n") 
     11 
     12    for(i: 0 .. #vararg) 
     13        sb.append("\t", vararg[i], " = ", i, "\n") 
     14 
     15    sb.append("}") 
     16 
     17    loadString(sb.toString())() 
     18
     19 
     20enum("NodeType", 
     21    "Add", 
     22    "Mul", 
     23    "Var", 
     24    "Num" 
     25
    2626 
    2727object ExpNode 
     
    3434    } 
    3535 
     36    function opCall(vararg) = :clone(vararg) 
    3637    function opAdd(other: ExpNode) = AddNode(this, other) 
    3738    function opMul(other: ExpNode) = MulNode(this, other) 
     
    4344    { 
    4445        local ret = super.clone(NodeType.Var) 
    45         ret.type = NodeType.Var 
    4646        ret.name = name 
    4747        return ret 
     
    5151} 
    5252 
    53 Var.opCall = Var.clone 
    54  
    5553object Num : ExpNode 
    5654{ 
     
    5856    { 
    5957        local ret = super.clone(NodeType.Num) 
    60         ret.type = NodeType.Num 
    6158        ret.val = toFloat(val) 
    6259        return ret 
     
    6663} 
    6764 
    68 Num.opCall = Num.clone 
    69  
    70 object AddNode : ExpNode 
    71 
    72     function clone(left: ExpNode, right: ExpNode) 
    73     { 
    74         local ret = super.clone(NodeType.Add) 
     65object BinNode : ExpNode 
     66
     67    function clone(type: int, left: ExpNode, right: ExpNode) 
     68    { 
     69        local ret = super.clone(type) 
    7570        ret.left = left 
    7671        ret.right = right 
    7772        return ret 
    7873    } 
    79  
     74
     75 
     76object AddNode : BinNode 
     77
     78    function clone(left: ExpNode, right: ExpNode) = super.clone(NodeType.Add, left, right) 
    8079    function toString() = format("({} + {})", :left, :right) 
    8180} 
    8281 
    83 AddNode.opCall = AddNode.clone 
    84  
    85 object MulNode : ExpNode 
    86 
    87     function clone(left: ExpNode, right: ExpNode) 
    88     { 
    89         local ret = super.clone(NodeType.Mul) 
    90         ret.left = left 
    91         ret.right = right 
    92         return ret 
    93     } 
    94  
     82object MulNode : BinNode 
     83
     84    function clone(left: ExpNode, right: ExpNode) = super.clone(NodeType.Mul, left, right) 
    9585    function toString() = format("({} * {})", :left, :right) 
    9686} 
    97  
    98 MulNode.opCall = MulNode.clone 
    9987 
    10088function searchVars(n: ExpNode, vars: table) 
     
    121109    searchVars(root, vars) 
    122110    local params = string.join(vars.keys().sort(), ", ") 
    123     return loadString("return \\" ~ params ~ " -> " ~ root.toString())(
     111    return eval("\\" ~ params ~ " -> " ~ root.toString()
    124112} 
    125113 
     
    129117local f = compileExp(exp) 
    130118writeln(f(3, 4)) 
     119 
     120*/ 
    131121 
    132122// object Foo 
     
    149139//      writefln("Foo: {}, {}", :x, :y) 
    150140//  } 
    151 //  
     141// 
    152142//  function opAdd(other: Foo) 
    153143//  { 
     
    156146//  } 
    157147// } 
    158 //  
     148// 
    159149// object Bar : Foo 
    160150// { 
     
    162152// 
    163153//  function clone() = super.clone(-1, -10) 
    164 //  
     154// 
    165155//  function write() 
    166156//  { 
     
    169159//  } 
    170160// } 
    171 //  
     161// 
    172162// local f = Foo.clone(5, 10) 
    173163// f.write(); 
     
    966956    foreach(k, v; "hello") 
    967957        writefln("str[", k, "] = ", v) 
    968      
     958 
    969959    writefln() 
    970960 
     
    11591149        } 
    11601150    } 
    1161 }+/+/+/ 
     1151}+/+/ 
  • branches/v2new/test.d

    r387 r390  
    55 
    66import minid.api; 
    7  
    8 // version = TestArc; 
     7import minid.bind; 
     8 
     9version = TestArc; 
    910 
    1011void main() 
     
    3132        auto ex = catchException(t); 
    3233        Stdout.formatln("Error: {}", e); 
    33          
     34 
    3435        auto tb = getTraceback(t); 
    3536        Stdout.formatln("{}", getString(t, tb)); 
     
    148149            ) 
    149150        )(t); 
    150          
     151 
    151152        WrapModule! 
    152153        (