LuaNET, the lua 5.1 api documentation!

How To/Highlight lua source code/GeSHi

This is an example, to show how GeSHi can highlight lua-sourcecode.

Since there have been some misstakes in the lua.php (which is delivered with geshi), you can find an improved one as download.

Code
function split ( seperator, str ) 
local pos, arr = 0, {}
for st, sp in function() return string.find( str, seperator, pos, true ) end do -- for each divider found
table.insert( arr, string.sub( str, pos, st-1 ) ) -- Attach chars left of current divider
pos = sp + 1 -- Jump past current divider
end
table.insert( arr, string.sub( str, pos ) ) -- Attach chars right of last divider
return arr
end
Comments
© 2007 DracoBlue :: Valid XHTML, CSS, RSS Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | SourceNet © 2007, DracoBlue :: Page created in 0.442 seconds with 30 queries.