Files
hakorune/src/main.rs

83 lines
2.2 KiB
Rust
Raw Normal View History

/*!
* Nyash Rust Implementation - Everything is Box in Memory Safe Rust
*
* This is the main entry point for the Rust implementation of Nyash,
* demonstrating the "Everything is Box" philosophy with Rust's ownership system.
*
* The main function serves as a thin entry point that delegates to the CLI
* and runner modules for actual processing.
*/
// Core modules
pub mod box_trait;
pub mod boxes;
pub mod box_factory; // 🏭 Unified Box Factory Architecture (Phase 9.78)
feat(phase-9.75e): Complete using nyashstd standard library implementation 🎉 Phase 9.75e完了: using nyashstdシステム完全実装成功 ✅ 実装完了項目: - USING tokenizer integration: TokenType::USING token support - UsingStatement AST node: Complete using statement parsing - BuiltinStdlib infrastructure: Core standard library framework - Full interpreter integration: Complete namespace resolution - Module system integration: Fixed crate::stdlib import issues 🌟 動作確認済み標準ライブラリ機能: - string.create("text") → StringBox creation - string.upper(str) → Uppercase string conversion - integer.create(42) → IntegerBox creation - bool.create(true) → BoolBox creation - array.create() → Empty ArrayBox creation - console.log("message") → Console output 📋 実装ファイル: - src/tokenizer.rs: USING token support - src/ast.rs: UsingStatement AST node - src/parser/statements.rs: using statement parser - src/interpreter/statements.rs: using statement execution - src/interpreter/core.rs: stdlib namespace resolution - src/stdlib/mod.rs: Complete BuiltinStdlib implementation - src/lib.rs + src/main.rs: Module declaration integration 🎯 テスト成功: All nyashstd functions work perfectly with comprehensive test coverage. Local test file: local_tests/test_nyashstd.nyash Everything is Box哲学を維持しながらモダンな標準ライブラリアクセスを実現\! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 01:12:10 +09:00
pub mod stdlib;
pub mod environment;
pub mod tokenizer;
pub mod ast;
pub mod parser;
pub mod interpreter;
pub mod instance_v2; // 🎯 Phase 9.78d: Simplified InstanceBox implementation
pub mod core; // core::model (shared models)
pub mod channel_box;
pub mod finalization;
pub mod exception_box;
pub mod method_box;
pub mod scope_tracker; // VM scope lifecycle
pub mod operator_traits;
pub mod box_arithmetic; // 🚀 Moved from box_trait.rs for better organization
pub mod value; // 🔥 NyashValue Revolutionary System
feat(phase-9.75e): Complete using nyashstd standard library implementation 🎉 Phase 9.75e完了: using nyashstdシステム完全実装成功 ✅ 実装完了項目: - USING tokenizer integration: TokenType::USING token support - UsingStatement AST node: Complete using statement parsing - BuiltinStdlib infrastructure: Core standard library framework - Full interpreter integration: Complete namespace resolution - Module system integration: Fixed crate::stdlib import issues 🌟 動作確認済み標準ライブラリ機能: - string.create("text") → StringBox creation - string.upper(str) → Uppercase string conversion - integer.create(42) → IntegerBox creation - bool.create(true) → BoolBox creation - array.create() → Empty ArrayBox creation - console.log("message") → Console output 📋 実装ファイル: - src/tokenizer.rs: USING token support - src/ast.rs: UsingStatement AST node - src/parser/statements.rs: using statement parser - src/interpreter/statements.rs: using statement execution - src/interpreter/core.rs: stdlib namespace resolution - src/stdlib/mod.rs: Complete BuiltinStdlib implementation - src/lib.rs + src/main.rs: Module declaration integration 🎯 テスト成功: All nyashstd functions work perfectly with comprehensive test coverage. Local test file: local_tests/test_nyashstd.nyash Everything is Box哲学を維持しながらモダンな標準ライブラリアクセスを実現\! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 01:12:10 +09:00
pub mod type_box; // 🌟 TypeBox revolutionary system
pub mod messaging; // 🌐 P2P Communication Infrastructure
pub mod transport; // 🌐 P2P Communication Infrastructure
// 🚀 MIR Infrastructure
pub mod mir;
// 🚀 Backend Infrastructure
pub mod backend;
feat(phase-9.75e): Complete using nyashstd standard library implementation 🎉 Phase 9.75e完了: using nyashstdシステム完全実装成功 ✅ 実装完了項目: - USING tokenizer integration: TokenType::USING token support - UsingStatement AST node: Complete using statement parsing - BuiltinStdlib infrastructure: Core standard library framework - Full interpreter integration: Complete namespace resolution - Module system integration: Fixed crate::stdlib import issues 🌟 動作確認済み標準ライブラリ機能: - string.create("text") → StringBox creation - string.upper(str) → Uppercase string conversion - integer.create(42) → IntegerBox creation - bool.create(true) → BoolBox creation - array.create() → Empty ArrayBox creation - console.log("message") → Console output 📋 実装ファイル: - src/tokenizer.rs: USING token support - src/ast.rs: UsingStatement AST node - src/parser/statements.rs: using statement parser - src/interpreter/statements.rs: using statement execution - src/interpreter/core.rs: stdlib namespace resolution - src/stdlib/mod.rs: Complete BuiltinStdlib implementation - src/lib.rs + src/main.rs: Module declaration integration 🎯 テスト成功: All nyashstd functions work perfectly with comprehensive test coverage. Local test file: local_tests/test_nyashstd.nyash Everything is Box哲学を維持しながらモダンな標準ライブラリアクセスを実現\! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-16 01:12:10 +09:00
// 📊 Performance Benchmarks
pub mod benchmarks;
// 🚀 Refactored modules for better organization
pub mod cli;
pub mod runner;
// BID-FFI / Plugin System (prototype)
pub mod bid;
// Configuration system
pub mod config;
// Runtime system (plugins, registry, etc.)
pub mod runtime;
pub mod debug;
use nyash_rust::cli::CliConfig;
use runner::NyashRunner;
/// Thin entry point - delegates to CLI parsing and runner execution
fn main() {
// Parse command-line arguments
let config = CliConfig::parse();
// Create and run the execution coordinator
let runner = NyashRunner::new(config);
runner.run();
}
#[cfg(test)]
mod tests {
use super::*;
use box_trait::{StringBox, BoxCore, NyashBox};
#[test]
fn test_main_functionality() {
// This test ensures the module structure is correct
let string_box = StringBox::new("test".to_string());
assert_eq!(string_box.to_string_box().value, "test");
}
}