Ticket #19 (closed feature request: fixed)

Opened 8 years ago

Last modified 8 years ago

Annotated trees

Reported by: jcpetruzza@… Owned by: nibro
Priority: major Milestone:
Component: syntax Version:
Keywords: Cc:


It would be interesting if the ASTs allowed for used-defined annotations.

For example, right now one can parse a source file and get something of type Module; the idea would be to instead obtain something of type Module (). One could then analyze it and transform it into something of type Module (Maybe TypeAnnotations) (e.g. including the type of some the expressions and subexpressions) or Module DefiningModule (e.g. annotating each function with the module that defined it), etc.

Perhaps this can be related to ticket #12: SrcLoc might be removed from the AST definitions and instead become a form of used-defined annotation (Module SrcLoc) together with the ability to have an alternate parser that returns expressions of type Module SrcSpan.

Change History

Changed 8 years ago by nibro

  • milestone Full code support deleted

I definitely agree, and it's highly likely that it would be implemented like you suggest, together with #12.

Changed 8 years ago by nibro

  • status changed from new to closed
  • resolution set to fixed

An annotated AST is now implemented and appears in versions >= 1.1.3 as experimental. It will become stable from 1.2.0.

Note: See TracTickets for help on using tickets.