Bug fixes:
This release adds minor changes to the XForm grammar along with some bug fixes
The XForm Grammar has been changed as follows:
remove //IfStatement
removes all IfStatements from the AST.
add Foo<> to //Bar
adds a Foo node as the last child to all
Bar nodes.
Bug fixes:
insert Foo<> before //Bar
inserts Foo nodes before all Bar nodes in the AST
//IfStatement differ //IfStatement[ Block ]
returns a list of all IfStatements that do not have a Block
//IfStatement[ Block ]
returns all IfStatement nodes that have a Block child. //Block/*[ last(.) ]
returns the last child of each Block node in the AST
function_directory
file has been removed from XForm and a new
mechanism for loading external functions has been introduced. If you'd like
to use an external function within your query, you must first include an
import
statement at the beginning of your query.
run
method will return a list of lists. Furthermore, the results
of each expression will provide an implicit focus for the expression that
follows it.
For example, the query
//IfStatement, CompoundStatement
will return a list of two lists. The first list will contain
all IfStatement
nodes in the AST, whereas the second list will
contain all CompoundStatement
children of
IfStatement
nodes. This feature has proven helpful when
attempting to gather statistics about a body of source code.
inside_out
path
specifier. For example:
inside_out ForStatement/CompoundStatement
The above code will perform a bottom-up, breadth-first traversal of
the AST, searching for any CompoundStatement
children
of ForStatement
nodes.
xtc.xform.Parent
class has been removed, and
its functionality has been subsumed by
the xtc.xform.Item
class.
test
method of the QueryVisitor
class has been rewritten for efficiency.