Skip to content

Commit 59e9ea3

Browse files
committed
Cleanup
1 parent f23f909 commit 59e9ea3

File tree

6 files changed

+5
-165
lines changed

6 files changed

+5
-165
lines changed

docs-language/control-flow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import TokenScriptCodeBlock from '@site/src/components/TokenScriptCodeBlock';
1010

1111
TokenScript executes statements sequentially within a single global scope. The interpreter maintains one `SymbolTable` (`src/interpreter/symbolTable.ts`), so variables declared in any block remain available globally unless reassigned later.
1212

13+
Each execution in schemas (types, functions) has it's own scope and cannot access the parents variables.
14+
1315
## Statement Evaluation
1416

1517
- Programs consist of a top-level list of statements. The interpreter walks the list and keeps the most recent non-null value as the block result.
@@ -97,5 +99,3 @@ return palette.length();
9799

98100
- Syntax errors (unexpected tokens, missing brackets) are raised during parsing with annotated source snippets.
99101
- Runtime errors (type mismatches, invalid method calls, excessive loop iterations) raise `InterpreterError` with the line number of the offending token.
100-
101-
Continue to [Built-in Functions](functions.md) for available runtime helpers and math utilities.

docs-language/errors.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs-language/functions.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ TokenScript exposes a standard library of functions supplied by the `FunctionsMa
1212

1313
| Function | Signature | Description |
1414
|-------------|-----------------------------------------------|---------------------------------------------------------------------|
15-
| `min` | `min(...values: Number | NumberWithUnit)` | Returns the smallest numeric value (units allowed when compatible). |
16-
| `max` | `max(...values: Number | NumberWithUnit)` | Returns the largest numeric value. |
17-
| `sum` | `sum(...values: Number | NumberWithUnit)` | Adds values, converting units via `UnitManager` when available. |
15+
| `min` | `min(...values: Number \| NumberWithUnit)` | Returns the smallest numeric value (units allowed when compatible). |
16+
| `max` | `max(...values: Number \| NumberWithUnit)` | Returns the largest numeric value. |
17+
| `sum` | `sum(...values: Number \| NumberWithUnit)` | Adds values, converting units via `UnitManager` when available. |
1818
| `average` | `average(...values: Number)` | Arithmetic mean of numeric arguments. |
1919
| `mod` | `mod(a: Number, b: Number)` | Modulo operation with safe handling for negatives. |
2020
| `round` | `round(value: Number)` | Bankers rounding (0.5 rounds to nearest even). |
@@ -47,10 +47,3 @@ TokenScript exposes a standard library of functions supplied by the `FunctionsMa
4747

4848
- The `FunctionsManager` loads additional functions from JSON specifications (see `docs/extensions/functions.md`, to be authored).
4949
- Spec-defined functions use the same validation pipeline and become available immediately after registration.
50-
51-
## Error Handling
52-
53-
- Functions validate argument counts and types. Violations produce descriptive error messages, e.g., `"log() base must be positive and not equal to 1."`
54-
- Unit-aware functions (`sum`, arithmetic operators) rely on `UnitManager`; missing conversions trigger conversion errors.
55-
56-
Next, review [Error Handling](errors.md) for interpreter and parser diagnostics.

docs-language/grammar.md

Lines changed: 0 additions & 96 deletions
This file was deleted.

docs-language/syntax.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,3 @@ Parentheses `()` override precedence as expected.
133133
## Error Reporting
134134

135135
The parser provides context-aware errors with line/column highlighting when encountering unexpected tokens, missing delimiters, or malformed type declarations. Runtime type mismatches and method resolution errors raise `InterpreterError` instances, reported with the source token metadata.
136-
137-
Proceed to [Types and Symbols](types.md) for a complete catalog of runtime types and their methods.

sidebars-language.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ const sidebars: SidebarsConfig = {
66
"types",
77
"control-flow",
88
"functions",
9-
"errors",
10-
"grammar",
119
],
1210
};
1311

0 commit comments

Comments
 (0)