language-ecmascript-0.10: JavaScript analysis tools

Safe HaskellNone

Language.ECMAScript3.Syntax.Annotations

Description

A few helpers to work with the AST annotations

Synopsis

Documentation

removeAnnotations :: Traversable t => t a -> t ()Source

Removes annotations from a tree

reannotate :: Traversable t => (a -> b) -> t a -> t bSource

Changes all the labels in the tree to another one, given by a function.

addExtraAnnotationField :: Traversable t => b -> t a -> t (a, b)Source

add an extra field to the AST labels (the label would look like (a, b) )

removeExtraAnnotationField :: Traversable t => t (a, b) -> t aSource

remove an extra field

assignUniqueIdsSource

Arguments

:: Traversable t 
=> Int

starting id

-> t a

tree root

-> (t (a, Int), Int) 

Assigns unique numeric (Int) ids to each node in the AST. Returns a pair: the tree annotated with UID's and the last ID that was assigned.