Mmrnmhrm 0.1 released

Robert Fraser fraserofthenight at gmail.com
Mon Aug 20 11:44:40 PDT 2007


Bruno Medeiros Wrote:

> It would be nice to have DMD's semantic analysis available in the IDE, 
> for example, by having semantic errors highlighted without having to 
> compile externally.
> However, I think trying to do any semantic feature that isn't already 
> exactly supported by DMD (like find-ref), will require understanding and 
> subsequent modification/use of DMD semantic code.

One of the main reasons I think that having DMD's semantic code available will, in the end, be a boon, is template and mixin code. It's impossible to bind every symbol reference without expanding mixins and templates (which may require CTFE). I think reusing DMD's code here might work better than reinventing the wheel, especially as it'll pick up bug fixes, etc.

 However I find that 
> Walter's code is very unstructured and user-unfriendly (to put it in 
> nice terms ;p), and trying to use it in it's original form for IDE 
> features is not the best approach.

It wasn't meant for extensibility or user consumption at all. But the gotos and #defines are making me very sad ;(.

 That's why in Mmrnmhrm/dtool DMD's 
> AST is converted to a different, more structured AST hierarchy.
> For example, in Mmrnmhrm's editor hyperlinking, how does it know how to 
> underline the element under the mouse cursor or not? It simply finds the 
> ASTNode in the cursor's text offset, and then checks to see if that node 
> is an instance of a Reference class. That's 2-3 lines of code. How would 
> one do that in DMD's AST, without having both false positives (selecting 
> non-references) and false negatives (not selecting references), I ask? 

Well, the descent AST is (as far as I gather it, I've just inherited the semantic stuff from Ary), a slightly modifided version that does indeed have source positions and is able to figure out what token is under the cursor.

> Anyone is welcome to answer, including Walter. ;)
> Ary, if you're still interested in that avenue, don't forget you can 
> reuse Mmrnmhrm find-ref test cases :)
> 

Anyways, it appears that the eclipse IDE front is evolving quickly, so all of you who like descent or =~ m/m\w*m/i should look forward to some impressively-featured IDEs within the next year.



More information about the Digitalmars-d-announce mailing list