fork of https://github.com/tree-sitter/tree-sitter-graph
Changelog#
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.
v0.9.2 -- 2023-04-14#
Library#
Added#
- The
parse_error::Excerpttype, which is used to show source excerpts, is now public.
v0.9.1 -- 2023-04-03#
CLI#
Added#
- Errors from parsing and checking the TSG file are now displayed with source excerpts.
v0.9.0 -- 2023-03-31#
Library#
Changed#
- 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).
CLI#
Changed#
- Parse errors are now displayed with the same excerpt style as execution errors.
0.8.0 -- 2023-03-29#
Library#
Fixed#
- Fix error formatting panic with strict execution.
Changed#
- The traits stored in
Functionsmust now implementSendandSyncto ensure they can be shared more easily in concurrent situations.
0.7.0 -- 2022-10-18#
DSL#
Added#
- Global variables can be given default string values using
global NAME = "STRING"syntax. - Function
eqto compare two values for equality. - Function
formatto format strings. - Function
concatto concatenate lists. - Function
jointo join a list of values using an optional separator.
Removed#
- References to undefined variables now result in errors, instead of assuming its an undeclared global variable.
Library#
Fixed#
- Query errors now report the correct column for errors on the first row of a query.
Added#
- The
Variablestype has additional methodsis_emptyanditer.
Changed#
- References to
ExecutionConfigpassed toFile::execute*are not required to be mutable anymore.
0.6.1 -- 2022-09-06#
Library#
Fixed#
- Cancellation errors during execution are now propagated all the way up, instead of being wrapped in other errors.
Added#
- The
ExecutionErrortype now supports formatting errors with excerpts from the program and TSG source by using the.display_prettymethod.
Changed#
Variables::nesteddoes now accept a non-mutable reference.
CLI#
Added#
- Execution errors now include excerpts from the program and TSG source when printed.
0.6.0 -- 20220-08-23#
Library#
Added#
- Cancellation of
ast::Fileexecution is now supported by passing an implementation of theCancellationFlagtrait. TheNoCancellationtype provides a noop implementation.
Fixed#
- Fixed bug in
Identifiersoast::Fileinstances can be safely shared between threads.
Changed#
- Functions are not passed as mutable anymore, so that they can safely used concurrently and reused between executions.
ast::File::executerequires an extraCancellationFlagparameter. Use&NoCancellationif no cancellation is required.
CLI#
Added#
- Global variables can be provided by passing
--global VAR=VALflags. Only string values are supported.
0.5.1 -- 2022-05-11#
DSL#
- Reference the new VS Code extension in the README.
0.5.0 -- 2022-05-09#
DSL#
Fixed#
- Report query errors with correct source locations.
Library#
Changed#
- In JSON output, all values are represented as objects with a
typefield indicating the value type, and additional value fields that vary per type.
CLI#
Added#
- Flag
--output/-oto set JSON output path.
0.4.0 -- 2022-03-21#
DSL#
Added#
- Global variable declarations.
- Attribute shorthands.
- List and set comprehensions.
Deprecated#
- Use of undeclared global variables.
Library#
Added#
- Module
parse_errorfor finding and displayingtree-sitterparse errors. - Option in
ExecutionConfigto automatically add debug graph node attributes that describe the source location and variable name of the originatingnodestatement in the DSL source.
Changed#
- Calls to
executewill fail with a runtime error if declared global variables are missing in the global environment. - Calls to
executewill 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
executeare replaced by a singleExecutionConfigargument, which makes it easier to add optional arguments without breaking all use sites.
Removed#
- The
execute_lazymethod has been removed. Lazy evalaution is enabled by setting thelazyflag in theExecutionConfig.
CLI#
Added#
- Flag
--allow-parse-errorsthat allows running against input files with parse errors.
Changed#
- Improved formatting of parse error messages.
0.3.0 - 2022-02-08#
DSL#
Added#
- 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.
Changed#
- 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
scanstatements, 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-indexto the more accuratenamed-child-index
Removed#
- The
scanstatement cannot be applied to values that are not local to the stanza, i.e., values that depend on scoped variables.
Library#
Added#
- Method
File::execute_lazyto use lazy evaluation strategy. - Methods
File::execute_intoandFile::execute_lazy_intoto use an existing graph instance, instead of creating a new one. - Various
Value::into_*andValue::as_*methods.
Changed#
- The method
Graph::display_withis renamed toGraph::pretty_print.
Deprecated#
- The method
File::parseis deprecated because it it not sound anymore, and should be replaced by theFile::from_strmethod. - The method
Value::into_syntax_nodeis deprecated, and should be replaced by explicit graph indexing.
Removed#
- The
Contextobject for string interning is removed, along with thectxparameters of methods.
CLI#
Added#
- JSON output mode for the resulting graph, controlled by the
--jsonflag. - A
--lazyflag to use the lazy evaluation strategy. - A
--quietflag to suppress graph output.