parser(match): add MVP type patterns (IntegerBox(x)/StringBox(s)) via AST If-chain; keep literal-only path using PeekExpr; add smoke app (apps/tests/match_type_pattern_basic.nyash); build + stage-2 smokes green

This commit is contained in:
Selfhosting Dev
2025-09-19 08:34:29 +09:00
parent f4e340da08
commit 9142476484
348 changed files with 2539 additions and 281 deletions

View File

@ -22,6 +22,9 @@ ExternCall (env.*) and println normalization: `docs/reference/runtime/externcall
## Table of Contents
- [SelfHosting (Dev Focus)](#self-hosting)
- [Try in Browser](#-try-nyash-in-your-browser-right-now)
- [🌟 Property System Revolution](#-property-system-revolution-september-18-2025)
- [Language Features](#-language-features)
- [Plugin System](#-revolutionary-plugin-system-typebox-architecture)
<a id="self-hosting"></a>
## 🧪 SelfHosting (Dev Focus)
@ -286,6 +289,64 @@ box EnhancedArray from ArrayBox {
---
## 🌟 **Property System Revolution (September 18, 2025)**
### The 4-Category Property Breakthrough
**Just completed: Revolutionary unification of all property types into one elegant syntax!**
```nyash
box RevolutionaryBox {
// 🔵 stored: Traditional field storage
name: StringBox
// 🟢 computed: Calculated every access
size: IntegerBox { me.items.count() }
// 🟡 once: Lazy evaluation with caching
once cache: CacheBox { buildExpensiveCache() }
// 🔴 birth_once: Eager evaluation at object creation
birth_once config: ConfigBox { loadConfiguration() }
birth() {
me.name = "Example"
// birth_once properties already initialized!
}
}
```
### Python Integration Breakthrough
**The Property System enables revolutionary Python → Nyash transpilation:**
```python
# Python side
class DataProcessor:
@property
def computed_result(self):
return self.value * 2
@functools.cached_property
def expensive_data(self):
return heavy_computation()
```
```nyash
// Auto-generated Nyash (1:1 mapping!)
box DataProcessor {
computed_result: IntegerBox { me.value * 2 } // computed
once expensive_data: ResultBox { heavy_computation() } // once
}
```
**Result**: Python code runs 10-50x faster as native Nyash binaries!
### Documentation
- **[Property System Specification](docs/proposals/unified-members.md)** - Complete syntax reference
- **[Python Integration Guide](docs/development/roadmap/phases/phase-10.7/)** - Python → Nyash transpilation
- **[Implementation Strategy](docs/private/papers/paper-m-method-postfix-catch/implementation-strategy.md)** - Technical details
---
## 🔌 **Revolutionary Plugin System (TypeBox Architecture)**
### TypeBox: The Universal Plugin Bridge (September 2025)