Writing a custom syntax highlighter?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Writing a custom syntax highlighter?

Post by EssoAir » Fri Oct 31, 2014 3:54 am

Hey guys!

I know this is nothing new, syntax highlighting has been implemented in every language since the dawn of multi-colored screens. But I can't seem to find someone that's implemented it in LiveCode. I'm more of the C-like syntax type coder and so I kinda need help here. I want make an IDE for a custom language I'm creating. I think LiveCode would be a great language to write this part in since I can make a cross-platform UI, but then use get shell() to talk to the compiler for my custom language. But all this syntax highlighting is confusing on its own. Add to it LC's syntax (which confuses me) and I'm sort of between a rock and a hard place.

I'd really appreciate any help at all!

Thanks!
EssoAir

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7314
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Writing a custom syntax highlighter?

Post by FourthWorld » Fri Oct 31, 2014 4:45 am

Everyhthing in the LiveCode IDE is written in LiveCode. You can explore things like the Script Editor's syntax highlighting by choosing "LiveCode UI elements appear in lists of stacks" in the Preferences window.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2236
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Writing a custom syntax highlighter?

Post by [-hh] » Fri Oct 31, 2014 5:33 am

Do you mean syntax highlighting by colors only?

The stack #44 (Nuzzler7b.livecode) of the "RaspberryPi Stacks" collection contains a colorizing script (= lines 70-294 of the stack's script; this is from the use-list archive by W. Abraham et al.).

You could use this as a base for your work relating to LiveCode scripts.
shiftLock happens

EssoAir
Posts: 52
Joined: Thu Feb 20, 2014 7:53 pm

Re: Writing a custom syntax highlighter?

Post by EssoAir » Wed Nov 12, 2014 1:41 pm

Thanks guy! I'm not really sure yet, tbh. I'm just trying to figure everything out. I'll have to check out both of those suggestions once I get to the implementation stage.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6468
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Writing a custom syntax highlighter?

Post by dunbarx » Wed Nov 12, 2014 2:30 pm

Check out therecent thread in the "Features" section of the forum about this issue.

Craig Newman

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6468
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Writing a custom syntax highlighter?

Post by dunbarx » Wed Nov 12, 2014 8:46 pm

See the spectacular results of a great detective in the "feature request" forum. All is right with the world.

Craig Newman

Post Reply

Return to “Talking LiveCode”