PDA

View Full Version : Lua Question



Bidmaron
October 1st, 2017, 17:49
My search fu is failing me. Do any of the coders here know of a web site where you can do Lua string pattern matching testing? I have ones I use for general expression matching tests and Microsoft Word pattern testing, but I cannot seem to locate one for lua pattern matching.

Be much obliged if any of you can share such a site if you know of one.

Minty23185Fresh
October 2nd, 2017, 21:06
Try the lua.org web site. I can't find it at the moment, but I could swear there was a little web browser based app that allowed just such a thing.

Here it is, though it's super simplistic.
https://www.lua.org/demo.html

Oops. Maybe that's not what you meant. The online manual is where I go to get help with pattern matching.
https://www.lua.org/pil/20.2.html

Bidmaron
October 2nd, 2017, 22:33
I have that but thanks for trying to help. I guess I will just have to make my own

Minty23185Fresh
October 2nd, 2017, 22:46
I thought of writing a "developer extension" that would help with testing code when one wanders into unfamiliar territory, and especially pattern matching.

Just adding a button in the tools area (where the party sheet , effects, options, colors, etc are). Then one would only need to put their code in the onButtonPress() to run it.

But I usually figured out the pattern before I became frustrated enough to write the extension.

Good luck.

Bidmaron
October 2nd, 2017, 23:02
I would not use a tools button. Make it a slash command so that we don't add unnecessary buttons for the tiny number of folks who will use such. The other things you'd want in a debugger extension that I have thought about are:

Ability to 'watch' a database node, which implements by adding an onChanged or whatever the event is. This is not as good as an IDE where you can watch actual variables change, but it is the next-best thing.

The cat's meow would be able to spontaneously test the various control-positioning options in-situ in a build-as-you-go window (or an edit of an existing windowclass).

The ability to turn on and off debugging statements (debug.console and debug.chat) through the use of a 'segment' architecture, where instead of calling debug.console/chat, you call the debug extension with a segment number. Then the extension keeps a database node with which segments are activated as a list in a window you can bring up. Ideally, this would let you turn on or off all the debug calls or enable only the activated segments. Hopefully, this is making sense.