ENIGMA Forums

General fluff => Announcements => Topic started by: Josh @ Dreamland on December 11, 2012, 11:39:46 AM

Title: JDI ↔ Parser: Code formatting, completion
Post by: Josh @ Dreamland on December 11, 2012, 11:39:46 AM
Tomorrow I take the last of my finals, and so by tomorrow evening I should, finally, be free to work on ENIGMA again. Forthevin has been doing a great job of adding things left and right, but I don't expect him (much less anyone else) to be able to help much with the parser. Especially if I haven't laid out any plans for it publicly.

I was looking at what I have done and what I need to do with it, when I noticed that one of the smaller bullet points for the parser—the ability to automatically format code neatly—is not presently possible for two simple reasons: comments and preprocessors.

Until those can be resolved, the parser will be incapable of correctly formatting code without dropping comments and potentially preprocessing away some code. The solution is simple, but it involves me editing JDI some more, which probably isn't what anyone wants to hear.

So let me present another benefit that can come from having JDI sew comments and preprocessor blocks into returned tokens: Javadoc-esque code completion.

If JDI reads comments in, ENIGMA or LGM can parse out formal comments like Javadoc and Doxygen do. Basically, we could use Doxygen to describe the purpose of GM functions in-line. When the user selects the function in the code completion menu, we could display information about each parameter and what exactly the function does, instead of just the names of the function and its parameters.

Another option is to have some duplicate code and let ENIGMA parse its own expressions independent of JDI. There is no other benefit to doing this, as JDI can handle any unary prefix, unary postfix, binary, or ternary operator already, including GML's ^^ and <> operators.

Or, I can just belay the code formatting idea all together and get the parser working how it does now.

It's up to you people, but try to decide before tomorrow when I actually have time to do some real coding.
Title: Re: JDI ↔ Parser: Code formatting, completion
Post by: polygone on December 11, 2012, 12:42:57 PM
Can't you just get the parser working now then come back to the comments/preprocessors at a later point? It seems to me rather minor compared to some other things that are needed.
Title: Re: JDI ↔ Parser: Code formatting, completion
Post by: Josh @ Dreamland on December 11, 2012, 12:53:43 PM
Yes, I can. It'll be a bigger pain later, but only slightly.
Title: Re: JDI ↔ Parser: Code formatting, completion
Post by: TheExDeus on December 11, 2012, 01:53:46 PM
I think get the parser done. There is still problems with variables in scripts that give a headache and I would love to see that fixed. Everything else is just a bonus. If you do make that Doxygen comment thing then I would love to comment some of the functions (at least the ones I made), that is if I remember how GIT worked.
Title: Re: JDI ↔ Parser: Code formatting, completion
Post by: Josh @ Dreamland on December 11, 2012, 10:22:53 PM
Then that's the plan.