✅ 削除完了(約700行のレガシー削除) - src/jit_stub.rs 完全削除(134行の何もしないスタブ) - src/backend/llvm_legacy/ アーカイブ化(壊れたLLVMバックエンド) - vm-legacy feature全削除(5ファイルの混乱する二重パス) - コメントアウトされたインタープリター削除 - JIT関連の巨大コメントブロック削除(350行以上) ✅ ChatGPTへの効果 - 完璧主義による掃除タイム削減 - 本質的な実装に集中可能 - 混乱する二重パスの排除 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
106 lines
3.2 KiB
Rust
106 lines
3.2 KiB
Rust
/*!
|
||
Nyash Programming Language — Rust library crate.
|
||
Provides parser, MIR, backends, runner, and supporting runtime.
|
||
*/
|
||
|
||
// Allow referring to this crate as `nyash_rust` from within the crate, matching external paths.
|
||
extern crate self as nyash_rust;
|
||
|
||
// WebAssembly support
|
||
#[cfg(target_arch = "wasm32")]
|
||
use wasm_bindgen::prelude::*;
|
||
|
||
pub mod ast; // using historical ast.rs
|
||
pub mod box_arithmetic;
|
||
pub mod box_factory; // unified Box Factory
|
||
pub mod box_operators; // operator implementations for basic Box types
|
||
pub mod box_trait;
|
||
pub mod boxes;
|
||
pub mod channel_box;
|
||
pub mod core; // core models shared by backends
|
||
pub mod environment;
|
||
pub mod exception_box;
|
||
pub mod finalization;
|
||
pub mod instance_v2; // simplified InstanceBox implementation
|
||
pub mod method_box;
|
||
pub mod operator_traits; // trait-based operator overloading
|
||
pub mod parser; // using historical parser.rs
|
||
pub mod scope_tracker; // Box lifecycle tracking for VM
|
||
pub mod stdlib;
|
||
pub mod tokenizer;
|
||
pub mod type_box; // TypeBox system (arithmetic moved from box_trait.rs)
|
||
|
||
pub mod value;
|
||
|
||
pub mod messaging;
|
||
pub mod transport;
|
||
|
||
// MIR (Mid-level Intermediate Representation)
|
||
pub mod mir;
|
||
#[cfg(feature = "aot-plan-import")]
|
||
pub mod mir_aot_plan_import {
|
||
pub use crate::mir::aot_plan_import::*;
|
||
}
|
||
|
||
// Backends
|
||
pub mod backend;
|
||
// JIT functionality archived to archive/jit-cranelift/
|
||
pub mod semantics; // Unified semantics trait for MIR evaluation/lowering
|
||
|
||
pub mod benchmarks;
|
||
|
||
// BID-FFI / Plugin system (prototype)
|
||
pub mod bid;
|
||
|
||
// Configuration system
|
||
pub mod config;
|
||
|
||
// CLI system
|
||
pub mod cli;
|
||
|
||
// Runtime system (plugins, registry, etc.)
|
||
pub mod debug;
|
||
pub mod runner_plugin_init;
|
||
pub mod runtime;
|
||
// Unified Grammar scaffolding
|
||
pub mod grammar;
|
||
pub mod syntax; // syntax sugar config and helpers
|
||
// Execution runner (CLI coordinator)
|
||
pub mod runner;
|
||
pub mod using; // using resolver scaffolding (Phase 15)
|
||
|
||
// Expose the macro engine module under a raw identifier; the source lives under `src/macro/`.
|
||
#[path = "macro/mod.rs"]
|
||
pub mod r#macro;
|
||
|
||
#[cfg(target_arch = "wasm32")]
|
||
pub mod wasm_test;
|
||
|
||
#[cfg(test)]
|
||
pub mod tests;
|
||
|
||
// Re-export main types for easy access
|
||
pub use ast::{ASTNode, BinaryOperator, LiteralValue};
|
||
pub use box_arithmetic::{AddBox, CompareBox, DivideBox, ModuloBox, MultiplyBox, SubtractBox};
|
||
pub use box_trait::{BoolBox, IntegerBox, NyashBox, StringBox, VoidBox};
|
||
pub use environment::{Environment, PythonCompatEnvironment};
|
||
pub use box_factory::RuntimeError;
|
||
pub use parser::{NyashParser, ParseError};
|
||
pub use tokenizer::{NyashTokenizer, Token, TokenType};
|
||
pub use type_box::{MethodSignature, TypeBox, TypeRegistry}; // 🌟 TypeBox exports
|
||
pub use boxes::console_box::ConsoleBox;
|
||
pub use boxes::debug_box::DebugBox;
|
||
pub use boxes::map_box::MapBox;
|
||
pub use boxes::math_box::{FloatBox, MathBox, RangeBox};
|
||
pub use boxes::null_box::{null, NullBox};
|
||
pub use boxes::random_box::RandomBox;
|
||
pub use boxes::sound_box::SoundBox;
|
||
pub use boxes::time_box::{DateTimeBox, TimeBox, TimerBox};
|
||
pub use channel_box::{ChannelBox, MessageBox};
|
||
pub use instance_v2::InstanceBox; // 🎯 新実装テスト(nyash_rustパス使用)
|
||
pub use method_box::{BoxType, EphemeralInstance, FunctionDefinition, MethodBox};
|
||
|
||
pub use value::NyashValue;
|
||
|
||
// WASM support to be reimplemented with VM/LLVM backends
|