Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Documentation

[docs/README.md](docs/README.md) | [CLI Guide](docs/cli.md) | [Language Reference](docs/lang-reference.md) | [Type System](docs/type-system.md) | [Runtime Engine](docs/runtime-engine.md) | [Binary Format](docs/binary-format/01-overview.md)
[docs/README.md](docs/README.md) | [CLI Guide](docs/cli.md) | [Language Reference](docs/lang-reference.md) | [Type System](docs/type-system.md) | [Runtime Engine](docs/runtime-engine.md) | [Tree Navigation](docs/tree-navigation.md) | [Binary Format](docs/binary-format/01-overview.md)

# Query Syntax Quick Reference

Expand All @@ -22,7 +22,7 @@
| `@x :: T` | Type annotation |
| `@x :: string` | Extract node text |
| `field: pattern` | Field constraint |
| `!field` | Negated field (assert absent) |
| `-field` | Negated field (assert absent) |
| `?` `*` `+` | Quantifiers (0-1, 0+, 1+) |
| `??` `*?` `+?` | Non-greedy variants |
| `.` | Anchor (adjacency, see below) |
Expand Down Expand Up @@ -146,7 +146,7 @@ Tree-sitter: `((a) (b))` — Plotnik: `{(a) (b)}`. The #1 syntax error.
crates/
plotnik-cli/ # CLI tool
src/commands/ # Subcommands (ast, check, dump, exec, infer, trace, langs)
plotnik-core/ # Common code (Interner, Symbol)
plotnik-core/ # Node type database (NodeTypes, StaticNodeTypes) and string interning (Interner, Symbol)
plotnik-lib/ # Plotnik as library
src/
analyze/ # Semantic analysis (symbol_table, dependencies, type_check, validation)
Expand Down
8 changes: 4 additions & 4 deletions crates/plotnik-lib/src/analyze/recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ impl<'a, 'd> RecursionValidator<'a, 'd> {

/// Finds a cycle within the given set of nodes (SCC).
/// `get_edge_location` returns the location of a reference from `expr` to `target`.
fn find_cycle<'s>(
fn find_cycle<'b>(
&self,
nodes: &'s [String],
domain: &IndexSet<&'s str>,
nodes: &'b [String],
domain: &IndexSet<&'b str>,
get_edge_location: impl Fn(&Self, SourceId, &Expr, &str) -> Option<TextRange>,
) -> Option<Vec<(SourceId, TextRange, &'s str)>> {
) -> Option<Vec<(SourceId, TextRange, &'b str)>> {
let mut adj = IndexMap::new();
for name in nodes {
if let Some((source_id, body)) = self.symbol_table.get_full(name) {
Expand Down
8 changes: 4 additions & 4 deletions crates/plotnik-lib/src/analyze/symbol_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ pub fn resolve_names(
symbol_table
}

struct ReferenceResolver<'q, 'd, 't> {
struct ReferenceResolver<'q, 'd, 'a> {
src: &'q str,
source_id: SourceId,
diag: &'d mut Diagnostics,
symbol_table: &'t mut SymbolTable,
symbol_table: &'a mut SymbolTable,
}

impl Visitor for ReferenceResolver<'_, '_, '_> {
Expand Down Expand Up @@ -172,10 +172,10 @@ impl Visitor for ReferenceResolver<'_, '_, '_> {
}
}

struct ReferenceValidator<'d, 't> {
struct ReferenceValidator<'d, 'a> {
source_id: SourceId,
diag: &'d mut Diagnostics,
symbol_table: &'t SymbolTable,
symbol_table: &'a SymbolTable,
}

impl Visitor for ReferenceValidator<'_, '_> {
Expand Down
2 changes: 1 addition & 1 deletion crates/plotnik-lib/src/analyze/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod context_tests;
#[cfg(test)]
mod symbol_tests;
#[cfg(test)]
mod tests;
mod type_check_tests;
#[cfg(test)]
mod unify_tests;

Expand Down
12 changes: 6 additions & 6 deletions crates/plotnik-lib/src/engine/materializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ pub trait Materializer<'t> {
}

/// Materializer that produces Value with resolved strings.
pub struct ValueMaterializer<'ctx> {
source: &'ctx str,
types: TypesView<'ctx>,
strings: StringsView<'ctx>,
pub struct ValueMaterializer<'a> {
source: &'a str,
types: TypesView<'a>,
strings: StringsView<'a>,
}

impl<'ctx> ValueMaterializer<'ctx> {
pub fn new(source: &'ctx str, types: TypesView<'ctx>, strings: StringsView<'ctx>) -> Self {
impl<'a> ValueMaterializer<'a> {
pub fn new(source: &'a str, types: TypesView<'a>, strings: StringsView<'a>) -> Self {
Self {
source,
types,
Expand Down