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
2 changes: 1 addition & 1 deletion docs/binary-format/05-entrypoints.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binary Format: Entrypoints

This section defines the named entry points for the query. Each definition can be executed against a syntax tree.
This section defines the named entry points for the query. Every named definition in the workspace is an entrypoint and can be executed against a syntax tree.

## Layout

Expand Down
2 changes: 1 addition & 1 deletion docs/lang-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ Expression = [
Str: (string) @value :: string
]

(program (Statement)+ @statements)
Root = (program (Statement)+ @statements)
```

Output types:
Expand Down
26 changes: 8 additions & 18 deletions docs/type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,17 @@ Scopes are transparent by default. Captures bubble up through definitions and co

This enables reusable fragments ("mixins") that contribute fields to parent output without creating nesting.

- **Private Definitions (`Def = ...`)**: Transparent (macro-like)
- **Definitions (`Def = ...`)**: Transparent (macro-like)
- **Uncaptured Containers (`{...}`, `[...]`)**: Transparent
- **References (`(Def)`)**: Transparent

### Explicit Scope Boundaries

New data structures are created only when explicitly requested:

1. **Public Roots**: `pub Def = ...`
2. **Captured Groups**: `{...} @name` → Struct
3. **Captured Alternations**: `[...] @name` → Union
4. **Tagged Alternations**: `[ L: ... ] @name` → Tagged Union
1. **Captured Groups**: `{...} @name` → Struct
2. **Captured Alternations**: `[...] @name` → Union
3. **Tagged Alternations**: `[ L: ... ] @name` → Tagged Union

## 2. Data Shapes

Expand Down Expand Up @@ -300,7 +299,7 @@ Self-referential types via:
### Example

```plotnik/docs/type-system.md#L213-219
pub Expr = [
Expr = [
Lit: (number) @value ::string
Binary: (binary_expression
left: (Expr) @left
Expand All @@ -324,7 +323,7 @@ B = (bar (A)) // OK: descends each step

### Scope Boundaries

Recursive private definitions get automatic type boundaries (behave like `pub` for typing):
Recursive definitions get automatic type boundaries:

```plotnik/docs/type-system.md#L240-241
NestedCall = (call_expression
Expand All @@ -340,21 +339,12 @@ DeepSearch = [
(identifier) @target
(_ (DeepSearch)*)
]
pub AllIdentifiers = (program (DeepSearch)*)
AllIdentifiers = (program (DeepSearch)*)
```

Output: `{ target: Node[] }` — flat array regardless of tree depth.

## 7. Definition Roles

| Feature | `Def` (Private) | `pub Def` (Public) |
| -------- | ------------------ | ------------------ |
| Concept | Fragment/Mixin | API Contract |
| Behavior | Inlined | Entrypoint |
| Scoping | Transparent | Boundary |
| Output | Merges into parent | Named Interface |

## 8. Type Metadata
## 7. Type Metadata

For codegen, types are named:

Expand Down