[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Tabs in Taskwindows



In message <9d8352a452.fjgraute@xxxxxxxxx> you wrote:

> Would it be possible for you to send me a copy of an application that
> uses tabs in its output so that I can have a play with it, that would
> save me from having to knock up something myself, thanks.

In the RiscLua distribution (see http://www.wra1th.plus.com/lua/risclua.html )
in the Utilities package there is an application !DisAsm. 
[NB. These utilities need the RiscLua 5.41 distro to be installed]
If you drag a Lua program, say a textfile with the single line 
              print "hello" 
onto !DisAsm's iconbar icon it opens a taskwindow to display a
disassembly of the Lua VM instructions that the program compiles into.
That should produce output:

    main <RAM::RamDisc0.$.Textfile:0,0> (4 instructions at 00028260)
    0+ params, 2 slots, 1 upvalue, 0 locals, 2 constants, 0 functions
    1[1]GETTABUP 0 0 -1; _ENV "print"
    2[1]LOADK    1 -2; "hello"
    3[1]CALL     0 2 1
    4[1]RETURN   0 1
    constants (2) for 00028260:
    1"print"
    2"hello"
    locals (0) for 00028260:
    upvalues (1) for 00028260:
    0_ENV10

This disassembly is produced by the binary luac541 (have a look at
last line of the TaskObey file !DisAsm.!Drag) and it is emitting
lots of tab characters; for example before the linenumbers, before
the [ and after the ] that show the source-linenumber. These do not
get translated to a single space, as I believe they should, in the
taskwindow. 

If you use !VMView (which interleaves the disassembly with the source
text) instead of !DisAsm you will see the instructions displayed as they 
should be. 

    print "hello"
    --[[
         1 GETTABUP  0 0 -1 ; _ENV "print"
         2 LOADK     1 -2 ; "hello"
         3 CALL      0 2 1
         4 RETURN    0 1
    --]]

That is because !VMView.!RunImage is massaging the output of luac541
and converting the tabs to spaces before sending the result to the
taskwindow. 

-- 
Gavin Wraith (gavin@xxxxxxxxxxxxxxx)
Home page: http://www.wra1th.plus.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx