Introjucer Mod: XML & Lua Code Editors (Kudos to other JUCE Users)


#1

Thanks to atom and chrisboy2000, code has been made available to tokenise and colourise Lua and XML code.

I've put their code into the Introjucer, if you'd like to give it a whirl.

http://www.juce.com/forum/topic/xmltokeniser

http://www.juce.com/forum/topic/lua-tokeniser

 

 


#2

smiley

If everyone involved is happy to waive their copyright on this stuff (sure, I know these aren't huge amounts of code, but gotta be careful about that kind of thing..), then I'd be glad to merge it in!


#3

Totally fine for me. In fact it makes me a little proud that my code becomes part of JUCE :) 

Perhaps you can alter the colour settings for it to make it consistent within the different tokenizers (I don't know about the Lua tokenizer but I chose the colours quite randomly)


#4

no problem on my side.


#5

Thanks chaps - I've added this now, though TBH very little (maybe none!) of the original code remains after I'd cleaned it up..

The XML parser was pretty far off the mark and I just rewrote that completely, but part of the problem is that the CodeTokeniser base class has to be used statelessly, and doing XML does involves some statefulness. Anyway, I quickly hacked it into a half-decent version that works statelessly, but don't have the time/inclination to add support for tokeniser state that'd be needed to do a more complete implementation.

This is all cool stuff to have though - thanks for getting it rolling!


#6

Hi,

Just spotted the Lua tokeniser. We have also just added Lua in our application but unfortunately we are using an older version of JUCE.

You can still add multiline strings (delimited by [[ ]] ):

s = [[multi
line
string]]

Similarly Lua has block comments (delimited by --[[ to ]] ):

--[[
multi
line
comment]]

--
Roeland