Mmrnmhrm 0.1 released

Ary Manzana ary at esperanto.org.ar
Mon Aug 20 12:30:47 PDT 2007


Robert Fraser escribió:
> 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.

That's exactly why I'm betting on DMD's semantic code.

> 
>  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 ;(.

It's amazing the number of gotos Walter uses. But, amazingly, all of 
them just are for one reason: not to duplicate (even a single line of) code.

> 
>  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.

I think he ment the Reference class.



More information about the Digitalmars-d-announce mailing list