Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
58058f3
Add GitHub Action to summarize new issues (#4)
JosunLP Nov 13, 2025
0a4d695
Add GitHub Actions workflow for greetings (#5)
JosunLP Nov 13, 2025
ef79449
Add workflow to manage stale issues and PRs (#6)
JosunLP Nov 13, 2025
064b93b
Merge branch 'dev' of https://github.com/Kink-Development-Group/hyp-r…
JosunLP Nov 13, 2025
2ef43d6
Adding Installer (#9)
JosunLP Nov 13, 2025
9daf557
Update version to 1.0.0-rc2 and change edition to 2024 in Cargo.toml …
JosunLP Nov 13, 2025
4e82a63
Refactor code for improved readability and safety in various modules
JosunLP Nov 13, 2025
e3c9133
Update .github/labeler.yml
JosunLP Nov 13, 2025
1bf5ead
Update hypnoscript-cli/src/main.rs
JosunLP Nov 13, 2025
9a072f3
Update scripts/build_linux.ps1
JosunLP Nov 13, 2025
f71efcd
Aktualisiere Labeler-Konfiguration und verbessere Installationsskript…
JosunLP Nov 13, 2025
c14df8f
Füge #[allow(dead_code)] zu InstallMetadata hinzu, um Warnungen zu un…
JosunLP Nov 13, 2025
c6ada80
Verbessere den Code-Stil durch Vereinheitlichung von Importen und Ver…
JosunLP Nov 13, 2025
7cae200
Vereinheitliche die Verwendung von `trim_start_matches` und verbesser…
JosunLP Nov 13, 2025
da8e2bc
Vereinheitliche die Verwendung von `or_else` und verbessere die Lesba…
JosunLP Nov 13, 2025
3d10d8c
Vereinheitliche die Verwendung von `or_else` in der Funktion `handle_…
JosunLP Nov 13, 2025
40d778a
Füge Dokumentation zur Installer-Synchronisation und Update-Automatis…
JosunLP Nov 13, 2025
0fad02e
Entferne den Verweis auf "Rust Edition" aus der Dokumentation und den…
JosunLP Nov 13, 2025
55094b4
Füge neue Lizenzen zur Allowlist hinzu und behandle ungenutzte Einträ…
JosunLP Nov 13, 2025
56e6f74
Update deny.toml
JosunLP Nov 13, 2025
b00ecd4
Verbessere die Windows-Unterstützung im Installer und aktualisiere di…
JosunLP Nov 13, 2025
b264902
Merge branch 'dev' of https://github.com/Kink-Development-Group/hyp-r…
JosunLP Nov 13, 2025
ff4a99a
Aktualisiere Copyright-Jahr auf 2025 in mehreren Dateien und verbesse…
JosunLP Nov 14, 2025
4c26bf7
Verbessere die Lesbarkeit des Codes im Selbstaktualisierungsprozess d…
JosunLP Nov 14, 2025
38e2fac
Aktualisiere Versionsnummer auf 1.0.0-rc2 in mehreren Skripten und de…
JosunLP Nov 14, 2025
00f004e
Vereinheitliche den Code zur Ableitung des Installationspfads im Selb…
JosunLP Nov 14, 2025
0ce4407
Merge remote-tracking branch 'origin/main' into dev
JosunLP Nov 14, 2025
5fa15c4
Feature/lib (#11)
JosunLP Nov 14, 2025
d1edcce
Feature/completion (#12)
JosunLP Nov 15, 2025
59b93ae
Merge branch 'main' into dev
JosunLP Nov 15, 2025
8d25f85
Merge branch 'main' into dev
JosunLP Nov 15, 2025
3954250
Feature/translation (#16)
JosunLP Nov 19, 2025
cb0fede
Add package manager with trance.json manifest support to CLI (#15)
Copilot Nov 19, 2025
738f7c7
Fix German/English language mixing in documentation (#18)
Copilot Nov 19, 2025
2264230
Fix CI workflow binary references after package manager rename (#19)
Copilot Nov 19, 2025
810d5a1
Fix CI/CD binary references after package manager CLI rename (#20)
Copilot Nov 21, 2025
5ce59da
Merge remote-tracking branch 'origin/main' into dev
JosunLP Jan 21, 2026
bb56c91
✨ feat: add debug builtins for enhanced debugging capabilities
JosunLP Jan 21, 2026
983bbd2
Refactor debugging documentation and CLI commands to improve clarity …
JosunLP Jan 21, 2026
3fd7101
Update changelog for version 1.2.0 release date and link
JosunLP Jan 21, 2026
0ff80d4
Refactor documentation for consistency and clarity:
JosunLP Jan 21, 2026
7d0cede
Refactor documentation for consistency and clarity in scripts and README
JosunLP Jan 21, 2026
5670ff2
Refactor localization strings to English for consistency across built…
JosunLP Jan 21, 2026
f317efd
Refactor documentation for consistency and clarity
JosunLP Jan 21, 2026
c59171d
Refactor documentation and code for consistency and clarity
JosunLP Jan 21, 2026
c1abe56
Refactor documentation and update dependencies for consistency and cl…
JosunLP Jan 21, 2026
1fe426a
Ändere die Methode zum Herunterladen des Installationsskripts, um den…
JosunLP Jan 21, 2026
37cd71c
Füge Ausnahme für aws-lc-sys mit mehreren Lizenzen hinzu
JosunLP Jan 21, 2026
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
98 changes: 98 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# HypnoScript Copilot Instructions

## Architecture Overview

HypnoScript is a hypnotically-themed programming language with a pure Rust implementation (Rust 2024 edition). The compilation pipeline flows:

```
Source (.hyp) → Lexer → Tokens → Parser → AST → TypeChecker → Interpreter/Compiler
```

**Workspace crates (dependency order):**

| Crate | Purpose | Key Exports |
| -------------------------- | --------------------------- | ------------------------------------------------------------------------ |
| `hypnoscript-core` | Type system foundation | `HypnoType`, `HypnoBaseType`, `SymbolTable` |
| `hypnoscript-lexer-parser` | Tokenization & AST | `Lexer`, `Parser`, `AstNode`, `Token` |
| `hypnoscript-runtime` | 180+ builtins (20+ modules) | `MathBuiltins`, `StringBuiltins`, `ArrayBuiltins`, etc. |
| `hypnoscript-compiler` | All backends | `Interpreter`, `TypeChecker`, `WasmCodeGenerator`, `NativeCodeGenerator` |
| `hypnoscript-cli` | CLI + package manager | Commands: `exec`, `lex`, `parse`, `check`, `compile-wasm` |

## Essential Commands

```bash
# Development cycle
cargo build --all # Debug build
cargo run -p hypnoscript-cli -- exec file.hyp # Run .hyp file
cargo run -p hypnoscript-cli -- exec file.hyp --debug # Interactive debugger

# Testing (185+ tests, run on Windows/Linux/macOS in CI)
cargo test --all # All tests
cargo test --package hypnoscript-compiler -- --nocapture # Single crate with output
cargo test --package hypnoscript-runtime test_math # Specific test

# Pre-commit quality checks (enforced by CI)
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings

# Release build (LTO enabled, stripped)
cargo build --all --release
```

## Language Syntax Quick Reference

HypnoScript uses hypnotic-themed keywords. See [token.rs](hypnoscript-lexer-parser/src/token.rs) for complete list.

| HypnoScript | Equivalent | Example |
| ---------------------------- | ---------- | ---------------------------------------------------------------- |
| `Focus { } Relax` | program | `Focus { observe "hi"; } Relax` |
| `induce`/`freeze` | let/const | `induce x: number = 42;` |
| `suggestion` | function | `suggestion add(a: number, b: number): number { awaken a + b; }` |
| `session` | class | `session Counter { expose count: number = 0; }` |
| `observe`/`whisper` | print | `observe "Hello";` (with newline) |
| `awaken` | return | `awaken result;` |
| `entrain`/`when`/`otherwise` | match | `entrain x { when 0 => "zero" otherwise => "other" }` |
| `yourEyesAreGettingHeavy` | >= | `if (x yourEyesAreGettingHeavy 10) deepFocus { }` |
| `lucidFallback` | ?? | `maybeNull lucidFallback 100` |

## Adding New Builtin Functions

1. **Create module** in `hypnoscript-runtime/src/` (e.g., `my_builtins.rs`)
2. **Implement trait** `BuiltinModule` from [builtin_trait.rs](hypnoscript-runtime/src/builtin_trait.rs):
```rust
impl BuiltinModule for MyBuiltins {
fn module_name() -> &'static str { "My" }
fn description() -> &'static str { "My builtin functions" }
fn function_names() -> &'static [&'static str] { &["MyFunc1", "MyFunc2"] }
}
```
3. **Export** in `hypnoscript-runtime/src/lib.rs`
4. **Register** in [interpreter.rs](hypnoscript-compiler/src/interpreter.rs) - add match arms in `call_builtin_function()`
5. **Add tests** as inline `#[cfg(test)] mod tests { }` at file end

## Code Conventions

- **Error handling**: Use `thiserror` with `#[derive(Error)]`. User-facing errors support i18n via `LocalizedMessage` (EN, DE, FR, ES)
- **AST nodes**: All constructs map to variants in `AstNode` enum ([ast.rs](hypnoscript-lexer-parser/src/ast.rs))
- **Tests**: Inline modules at file end with `#[cfg(test)]`. Test `.hyp` files in `hypnoscript-tests/`
- **Workspace deps**: Shared dependencies defined in root `Cargo.toml` under `[workspace.dependencies]`

## Package Manager (trance.json)

HypnoScript projects use themed manifest keys:

- `ritualName` → package name, `mantra` → version
- `anchors`/`deepAnchors` → dependencies/devDependencies
- `suggestions` → npm-style scripts

See [package.rs](hypnoscript-cli/src/package.rs) for schema.

## Key Files Reference

| File | Purpose |
| ------------------------------------------------------------ | -------------------------------------------- |
| [interpreter.rs](hypnoscript-compiler/src/interpreter.rs) | Main runtime (3400+ lines), builtin dispatch |
| [ast.rs](hypnoscript-lexer-parser/src/ast.rs) | All 30+ AST node variants |
| [token.rs](hypnoscript-lexer-parser/src/token.rs) | Token types & hypnotic keyword mappings |
| [types.rs](hypnoscript-core/src/types.rs) | `HypnoType` enum, type inference |
| [builtin_trait.rs](hypnoscript-runtime/src/builtin_trait.rs) | `BuiltinModule` trait for extending runtime |
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Labeler-Konfiguration für HypnoScript
# Labeler configuration for HypnoScript
# See https://github.com/actions/labeler for configuration format.

'area:core':
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Für VitePress lastUpdated-Feature
fetch-depth: 0 # For VitePress lastUpdated feature

- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ jobs:

## Installation

### Automatisches Setup (Linux/macOS)
### Automatic setup (Linux/macOS)
```bash
curl -fsSL https://kink-development-group.github.io/hyp-runtime/install.sh | bash
```
Das Skript erkennt System & Architektur, verifiziert Checksums und aktualisiert vorhandene Installationen.
The script detects system & architecture, verifies checksums, and updates existing installations.

### Linux/macOS
```bash
Expand Down
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,60 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/).

## [1.2.0] - 2026-01-22

### Added

- **Complete Debugging Infrastructure** with interactive step-through execution:
- New `hypnoscript-compiler/src/debug.rs` module with `DebugState`, `StepMode`, `CallFrame`, `WatchExpression`, and `PauseReason` types
- Breakpoint management (set, remove, clear, list)
- Step modes: Step Into, Step Over, Step Out, Continue
- Call stack tracking with function name, line number, and local variables
- Watch expressions for monitoring values during debugging
- Source code display with breakpoint markers

- **Debug REPL** (`hypnoscript-cli/src/debug_repl.rs`) for interactive debugging sessions:
- Commands: `break`, `delete`, `continue`, `step`, `next`, `out`, `print`, `locals`, `stack`, `watch`, `list`, `where`, `help`, `quit`
- Expression evaluation in current scope
- Variable inspection (locals, globals, all variables)
- Configurable via `DebugConfig` with initial breakpoints and watches

- **Debug Builtins** (`hypnoscript-runtime/src/debug_builtins.rs`):
- `inspect(value)` - Returns value with type information
- `typeOf(value)` - Returns the type name
- `stackTrace()` - Returns formatted call stack
- `dump(value)` - Prints detailed value representation
- `assertEqual()`, `assertNotEqual()`, `assertTruthy()`, `assertFalsy()`, `assertNull()`, `assertNotNull()` - Assertions with messages
- `time(label)`, `timeEnd(label)`, `measureTime(fn)` - Performance timing
- `log()`, `warn()`, `error()`, `trace()` - Debug output levels
- `breakpoint()` - Programmatic breakpoint

- **Extended CLI Debug Options** for the `exec` command:
- `--debug` / `-d` - Enable interactive debug mode
- `--breakpoints <LINES>` - Set initial breakpoints (comma-separated line numbers)
- `--watch <EXPRS>` - Set initial watch expressions (comma-separated)
- `--trace-file <PATH>` - Output trace information to file

- **Interpreter Debug Integration**:
- `enable_debug_mode()` / `disable_debug_mode()` methods
- `set_breakpoint()`, `remove_breakpoint()`, `has_breakpoint()`, `clear_breakpoints()`
- `set_step_mode()`, `step_mode()` for stepping control
- `add_watch()`, `remove_watch()` for watch expressions
- `debug_locals()`, `debug_globals()`, `debug_all_variables()` for variable inspection
- `debug_call_stack()`, `debug_source_context()` for execution context

### Changed

- Extended `Interpreter` struct with optional `debug_state` field
- Updated CLI `exec` command to support debug mode with REPL integration

### Tests

- Added 9 new debug mode tests in `interpreter.rs`
- Added comprehensive unit tests for `DebugState`, `DebugCommand`, `CallFrame`
- Added unit tests for `DebugBuiltins` (assertions, timing, inspection)
- Added unit tests for `DebugSession` and `DebugConfig`

## [1.0.0] - 2025-11-15

### Added
Expand Down Expand Up @@ -30,3 +84,4 @@ All notable changes to this project will be documented in this file. The format
- Successfully completed `cargo deny check` with cleaned-up license and advisory checks.

[1.0.0]: https://github.com/Kink-Development-Group/hyp-runtime/releases/tag/1.0.0
[1.2.0]: https://github.com/Kink-Development-Group/hyp-runtime/releases/tag/1.2.0
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
]

[workspace.package]
version = "1.0.0"
version = "1.2.0"
edition = "2024"
authors = ["Kink Development Group"]
license = "MIT"
Expand All @@ -18,11 +18,11 @@ repository = "https://github.com/Kink-Development-Group/hyp-runtime"
[workspace.dependencies]
# Core dependencies shared across workspace
anyhow = "1.0"
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "rustls-tls"] }
csv = "1.3"
thiserror = "2.0.18"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
reqwest = { version = "0.13.1", default-features = false, features = ["json", "blocking", "query", "rustls"] }
csv = "1.4.0"

[profile.release]
opt-level = 3
Expand Down
Loading
Loading