All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Upgraded the tree-sitter
dependency to version 0.24.
- Excerpts shown as part of errors now use formatting that works both in light and dark mode.
- Support adding an edge multiple times, or setting an attribute multiple times with the same value. Previously these would raise runtime errors.
Updated the tree-sitter
dependency to include the required minimal patch version.
- Store a debug attribute for the matched syntax node, providing information about the syntactic category of the match that gave rise to the graph node.
- A panic that sometimes occurred in lazy execution mode.
- Several errors include more context in the error message: Duplicate errors report both statements using source snippets. Edge statements report which argument (the source or the sink) triggered an evluation error.
- Ensure that edge attribute statements are executed after edges are created, to prevent non-deterministic ordering bugs in lazy execution mode.
- Scoped variables can be inherited by child nodes by specifying
inherit .var_name
as part of the source. Using@node.var_name
will either use the value set on the node itself, or otherwise the one set on the closest enclosing node.
- Edge debug information now contains the TSG location of the
edge
statement ifExecutionConfig::location_attr
is set.
- The TSG location in the debug information is formatted more explicitly as
line XX column YY
instead of(XX, YY)
.
- The
ast::File::try_visit_matches
method can be used to execute the stanza query matching without executing the stanza bodies.
- Unused captures in patterns are now considered errors, unless they start with an underscore.
- Some execution errors were not always reported in lazy execution mode, depending on whether variables were used or not. This has been fixed to behave more consistently, so that errors are always reported regardless of variable use.
- Errors from setting a scoped variable twice on the same node are now reported with source snippets for both statements involved.
- The
parse_error::Excerpt
type, which is used to show source excerpts, is now public.
- Errors from parsing and checking the TSG file are now displayed with source excerpts.
- The method
ParseError::display(source: &str, verbose: bool)
has been replaced by two methodsParseError::display(path: &path, source: &str)
andParseError::display_pretty(path: &Path, source: &str)
.
- Parse errors are now displayed with the same excerpt style as execution errors.
- Fix error formatting panic with strict execution.
- The traits stored in
Functions
must now implementSend
andSync
to ensure they can be shared more easily in concurrent situations.
- Global variables can be given default string values using
global NAME = "STRING"
syntax. - Function
eq
to compare two values for equality. - Function
format
to format strings. - Function
concat
to concatenate lists. - Function
join
to join a list of values using an optional separator.
- References to undefined variables now result in errors, instead of assuming its an undeclared global variable.
- Query errors now report the correct column for errors on the first row of a query.
- The
Variables
type has additional methodsis_empty
anditer
.
- References to
ExecutionConfig
passed toFile::execute*
are not required to be mutable anymore.
- Cancellation errors during execution are now propagated all the way up, instead of being wrapped in other errors.
- The
ExecutionError
type now supports formatting errors with excerpts from the program and TSG source by using the.display_pretty
method.
Variables::nested
does now accept a non-mutable reference.
- Execution errors now include excerpts from the program and TSG source when printed.
- Cancellation of
ast::File
execution is now supported by passing an implementation of theCancellationFlag
trait. TheNoCancellation
type provides a noop implementation.
- Fixed bug in
Identifier
soast::File
instances can be safely shared between threads.
- Functions are not passed as mutable anymore, so that they can safely used concurrently and reused between executions.
ast::File::execute
requires an extraCancellationFlag
parameter. Use&NoCancellation
if no cancellation is required.
- Global variables can be provided by passing
--global VAR=VAL
flags. Only string values are supported.
- Reference the new VS Code extension in the README.
- Report query errors with correct source locations.
- In JSON output, all values are represented as objects with a
type
field indicating the value type, and additional value fields that vary per type.
- Flag
--output
/-o
to set JSON output path.
- Global variable declarations.
- Attribute shorthands.
- List and set comprehensions.
- Use of undeclared global variables.
- Module
parse_error
for finding and displayingtree-sitter
parse errors. - Option in
ExecutionConfig
to automatically add debug graph node attributes that describe the source location and variable name of the originatingnode
statement in the DSL source.
- Calls to
execute
will fail with a runtime error if declared global variables are missing in the global environment. - Calls to
execute
will not fail early on parse trees with errors. Errors may occur during query execution if matched parts of the tree are missing. - The seperate arguments to
execute
are replaced by a singleExecutionConfig
argument, which makes it easier to add optional arguments without breaking all use sites.
- The
execute_lazy
method has been removed. Lazy evalaution is enabled by setting thelazy
flag in theExecutionConfig
.
- Flag
--allow-parse-errors
that allows running against input files with parse errors.
- Improved formatting of parse error messages.
- Loop statement to iterate over list values.
- Conditional statement to check optional and boolean values.
- Boolean functions
and
,or
, andnot
. - Lazy evaluation strategy that does not rely on textual stanza order.
- Variables are now scoped in blocks, and will not escape or overwrite variables defined in enclosing blocks.
- Fix nested function calls, which would lose their arguments.
- Fix nested
scan
statements, which would lose outer captures after the inner statement. - Construct capture values based in query quantifiers, e.g., create a list for
@cap*
or an optional value for@cap?
. - Rename
child-index
to the more accuratenamed-child-index
- The
scan
statement cannot be applied to values that are not local to the stanza, i.e., values that depend on scoped variables.
- Method
File::execute_lazy
to use lazy evaluation strategy. - Methods
File::execute_into
andFile::execute_lazy_into
to use an existing graph instance, instead of creating a new one. - Various
Value::into_*
andValue::as_*
methods.
- The method
Graph::display_with
is renamed toGraph::pretty_print
.
- The method
File::parse
is deprecated because it it not sound anymore, and should be replaced by theFile::from_str
method. - The method
Value::into_syntax_node
is deprecated, and should be replaced by explicit graph indexing.
- The
Context
object for string interning is removed, along with thectx
parameters of methods.
- JSON output mode for the resulting graph, controlled by the
--json
flag. - A
--lazy
flag to use the lazy evaluation strategy. - A
--quiet
flag to suppress graph output.