diff --git a/AGENTS.md b/AGENTS.md index 04682324..4590e6dd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 @@ -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) | @@ -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) diff --git a/crates/plotnik-lib/src/analyze/recursion.rs b/crates/plotnik-lib/src/analyze/recursion.rs index e2783459..638b4607 100644 --- a/crates/plotnik-lib/src/analyze/recursion.rs +++ b/crates/plotnik-lib/src/analyze/recursion.rs @@ -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, - ) -> Option> { + ) -> Option> { let mut adj = IndexMap::new(); for name in nodes { if let Some((source_id, body)) = self.symbol_table.get_full(name) { diff --git a/crates/plotnik-lib/src/analyze/symbol_table.rs b/crates/plotnik-lib/src/analyze/symbol_table.rs index e83fdc7f..a7afcce7 100644 --- a/crates/plotnik-lib/src/analyze/symbol_table.rs +++ b/crates/plotnik-lib/src/analyze/symbol_table.rs @@ -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<'_, '_, '_> { @@ -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<'_, '_> { diff --git a/crates/plotnik-lib/src/analyze/type_check/mod.rs b/crates/plotnik-lib/src/analyze/type_check/mod.rs index fd79a41d..509a5ef9 100644 --- a/crates/plotnik-lib/src/analyze/type_check/mod.rs +++ b/crates/plotnik-lib/src/analyze/type_check/mod.rs @@ -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; diff --git a/crates/plotnik-lib/src/analyze/type_check/tests.rs b/crates/plotnik-lib/src/analyze/type_check/type_check_tests.rs similarity index 100% rename from crates/plotnik-lib/src/analyze/type_check/tests.rs rename to crates/plotnik-lib/src/analyze/type_check/type_check_tests.rs diff --git a/crates/plotnik-lib/src/engine/materializer.rs b/crates/plotnik-lib/src/engine/materializer.rs index 88ac3ff4..f0dd678c 100644 --- a/crates/plotnik-lib/src/engine/materializer.rs +++ b/crates/plotnik-lib/src/engine/materializer.rs @@ -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,