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>
This commit is contained in:
Moe Charm
2025-08-16 01:12:10 +09:00
parent 1a1c668ae6
commit 87d776f3e7
13 changed files with 571 additions and 122 deletions

View File

@ -414,6 +414,12 @@ pub enum ASTNode {
span: Span,
},
/// using文: using namespace_name
UsingStatement {
namespace_name: String,
span: Span,
},
/// nowait文: nowait variable = expression
Nowait {
variable: String,
@ -609,6 +615,7 @@ impl ASTNode {
ASTNode::Loop { .. } => "Loop",
ASTNode::Return { .. } => "Return",
ASTNode::Break { .. } => "Break",
ASTNode::UsingStatement { .. } => "UsingStatement",
ASTNode::BoxDeclaration { .. } => "BoxDeclaration",
ASTNode::FunctionDeclaration { .. } => "FunctionDeclaration",
ASTNode::GlobalVar { .. } => "GlobalVar",
@ -668,6 +675,7 @@ impl ASTNode {
ASTNode::Print { .. } => ASTNodeType::Statement,
ASTNode::Return { .. } => ASTNodeType::Statement,
ASTNode::Break { .. } => ASTNodeType::Statement,
ASTNode::UsingStatement { .. } => ASTNodeType::Statement,
ASTNode::GlobalVar { .. } => ASTNodeType::Statement,
ASTNode::Include { .. } => ASTNodeType::Statement,
ASTNode::Local { .. } => ASTNodeType::Statement,
@ -716,6 +724,9 @@ impl ASTNode {
}
}
ASTNode::Break { .. } => "Break".to_string(),
ASTNode::UsingStatement { namespace_name, .. } => {
format!("UsingStatement({})", namespace_name)
}
ASTNode::BoxDeclaration { name, fields, methods, constructors, is_interface, extends, implements, .. } => {
let mut desc = if *is_interface {
format!("InterfaceBox({}, {} methods", name, methods.len())
@ -821,6 +832,7 @@ impl ASTNode {
ASTNode::Loop { span, .. } => *span,
ASTNode::Return { span, .. } => *span,
ASTNode::Break { span, .. } => *span,
ASTNode::UsingStatement { span, .. } => *span,
ASTNode::Nowait { span, .. } => *span,
ASTNode::Arrow { span, .. } => *span,
ASTNode::TryCatch { span, .. } => *span,