Lua Mock Api docs from engine source

Lua Mock Api docs from engine source

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Lua Mock Api docs from engine source

Post by PicassoCT »

Hi,
im trying to convert the documentation for the LuaApi int a loadable Mockup.
Not much to look at at the moment, due to Regex Fail.
Where did i go wrong?

ConverterRegex:

Code: Select all


(?P<Spring>Spring\.)(?P<FunctionName>[a-zA-Z0-9]+)([^\(]+\()(?<ArgPair>(?<ArgType>[a-zA-Z0-9]+)\W+(?<ArgName>[a-zA-Z0-9]+)([^a-zA-Z]+))+([^>]+>)([^\S]+)(?P<ReturnType>[a-zA-Z]+)
OutPutPattern:

Code: Select all

$Spring$FunctionName = function $FunctionName($Arguments)assert("$ArgumentType" == type($ArgName); return Mock$ReturnType end


https://github.com/PicassoCT/SpringLuaApi
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Lua Mock Api

Post by abma »

sorry, can't directly help with your problem but i moved the topic to engine development as only engine devs can likely help you. game devs can help when there is some useful output i guess :-)

(also adjusted topic)
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Lua Mock Api docs from engine source

Post by Beherith »

You failed at the part were you thought that you could use a regex on human written docs. Regex of that size is nearly write-only.

There are too many exceptions in the docs to allow this to work.

I apologize if this comment wasnt helpful, but it was about as helpful as your description of your error. :P
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua Mock Api docs from engine source

Post by PicassoCT »

Yes mock me... abma.. do it.. but i shall ride this dead horse, till the headcrab falls off dead ;)
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Lua Mock Api docs from engine source

Post by Anarchid »

I think this is different from the idea of generating inline lua api documentation. One is required for humans to understand how the API works; the other is required to make Lua IDE's understand what API exists.

Both probably have to be coded into engine or at least the build setup, though.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Lua Mock Api docs from engine source

Post by PicassoCT »

well, were it worked, it provides functionality at the moment- i hope abma delivers his part of the deal if i do the docu

https://github.com/PicassoCT/SpringLuaM ... ree/master
Post Reply

Return to “Engine”