✅ Phase 1 complete: Unified import system implemented and tested
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
@ -256,7 +256,7 @@ impl LiteralValue {
|
|||||||
/// LiteralValueをNyashBoxに変換
|
/// LiteralValueをNyashBoxに変換
|
||||||
pub fn to_nyash_box(&self) -> Box<dyn NyashBox> {
|
pub fn to_nyash_box(&self) -> Box<dyn NyashBox> {
|
||||||
use crate::box_trait::{StringBox, IntegerBox, BoolBox, VoidBox};
|
use crate::box_trait::{StringBox, IntegerBox, BoolBox, VoidBox};
|
||||||
use crate::boxes::math_box::FloatBox;
|
use crate::boxes::FloatBox;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
LiteralValue::String(s) => Box::new(StringBox::new(s)),
|
LiteralValue::String(s) => Box::new(StringBox::new(s)),
|
||||||
@ -272,7 +272,7 @@ impl LiteralValue {
|
|||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use crate::box_trait::{StringBox, IntegerBox, BoolBox, VoidBox};
|
use crate::box_trait::{StringBox, IntegerBox, BoolBox, VoidBox};
|
||||||
use crate::boxes::math_box::FloatBox;
|
use crate::boxes::FloatBox;
|
||||||
|
|
||||||
if let Some(string_box) = box_val.as_any().downcast_ref::<StringBox>() {
|
if let Some(string_box) = box_val.as_any().downcast_ref::<StringBox>() {
|
||||||
Some(LiteralValue::String(string_box.value.clone()))
|
Some(LiteralValue::String(string_box.value.clone()))
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox};
|
use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox};
|
||||||
use crate::boxes::math_box::FloatBox;
|
use crate::boxes::FloatBox;
|
||||||
use crate::operator_traits::{
|
use crate::operator_traits::{
|
||||||
NyashAdd, NyashSub, NyashMul, NyashDiv,
|
NyashAdd, NyashSub, NyashMul, NyashDiv,
|
||||||
DynamicAdd, DynamicSub, DynamicMul, DynamicDiv,
|
DynamicAdd, DynamicSub, DynamicMul, DynamicDiv,
|
||||||
|
|||||||
@ -104,7 +104,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::box_trait::{BoxCore, BoxBase, NyashBox, StringBox, IntegerBox, BoolBox};
|
use crate::box_trait::{BoxCore, BoxBase, NyashBox, StringBox, IntegerBox, BoolBox};
|
||||||
use crate::boxes::array::ArrayBox;
|
use crate::boxes::ArrayBox;
|
||||||
use std::fmt::{Debug, Display};
|
use std::fmt::{Debug, Display};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|||||||
@ -34,9 +34,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::box_trait::{NyashBox, StringBox, BoolBox, BoxCore, BoxBase};
|
use crate::box_trait::{NyashBox, StringBox, BoolBox, BoxCore, BoxBase};
|
||||||
use crate::boxes::intent_box::IntentBox;
|
use crate::boxes::{IntentBox, MapBox};
|
||||||
pub use crate::boxes::intent_box::Message;
|
pub use crate::boxes::intent_box::Message;
|
||||||
use crate::boxes::map_box::MapBox;
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|||||||
@ -68,8 +68,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, BoxCore, BoxBase};
|
use crate::box_trait::{NyashBox, StringBox, IntegerBox, BoolBox, BoxCore, BoxBase};
|
||||||
use crate::boxes::array::ArrayBox;
|
use crate::boxes::{ArrayBox, FloatBox};
|
||||||
use crate::boxes::math_box::FloatBox;
|
|
||||||
use std::fmt::{Debug, Display};
|
use std::fmt::{Debug, Display};
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::boxes::null_box::NullBox;
|
use crate::boxes::NullBox;
|
||||||
|
|
||||||
impl NyashInterpreter {
|
impl NyashInterpreter {
|
||||||
// StringBox methods moved to methods/basic_methods.rs
|
// StringBox methods moved to methods/basic_methods.rs
|
||||||
|
|||||||
@ -9,8 +9,7 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::ast::UnaryOperator;
|
use crate::ast::UnaryOperator;
|
||||||
use crate::boxes::{buffer::BufferBox, JSONBox, HttpClientBox, StreamBox, RegexBox, IntentBox, P2PBox};
|
use crate::boxes::{buffer::BufferBox, JSONBox, HttpClientBox, StreamBox, RegexBox, IntentBox, P2PBox};
|
||||||
use crate::boxes::math_box::FloatBox;
|
use crate::boxes::{FloatBox, MathBox, ConsoleBox, TimeBox, RandomBox, SoundBox, DebugBox, file::FileBox, MapBox};
|
||||||
use crate::boxes::{MathBox, ConsoleBox, TimeBox, RandomBox, SoundBox, DebugBox, file::FileBox, MapBox};
|
|
||||||
use crate::box_trait::BoolBox;
|
use crate::box_trait::BoolBox;
|
||||||
use crate::operator_traits::OperatorResolver;
|
use crate::operator_traits::OperatorResolver;
|
||||||
// TODO: Fix NullBox import issue later
|
// TODO: Fix NullBox import issue later
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
use super::super::*;
|
use super::super::*;
|
||||||
use crate::box_trait::{StringBox, IntegerBox, BoolBox, VoidBox};
|
use crate::box_trait::{StringBox, IntegerBox, BoolBox, VoidBox};
|
||||||
use crate::boxes::math_box::FloatBox;
|
use crate::boxes::FloatBox;
|
||||||
|
|
||||||
impl NyashInterpreter {
|
impl NyashInterpreter {
|
||||||
/// StringBoxのメソッド呼び出しを実行
|
/// StringBoxのメソッド呼び出しを実行
|
||||||
|
|||||||
@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
use super::super::*;
|
use super::super::*;
|
||||||
use crate::box_trait::{StringBox, IntegerBox, NyashBox, BoolBox};
|
use crate::box_trait::{StringBox, IntegerBox, NyashBox, BoolBox};
|
||||||
use crate::boxes::array::ArrayBox;
|
use crate::boxes::{ArrayBox, MapBox};
|
||||||
use crate::boxes::map_box::MapBox;
|
|
||||||
|
|
||||||
impl NyashInterpreter {
|
impl NyashInterpreter {
|
||||||
/// ArrayBoxのメソッド呼び出しを実行
|
/// ArrayBoxのメソッド呼び出しを実行
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
use super::super::*;
|
use super::super::*;
|
||||||
use crate::box_trait::{ResultBox, StringBox, NyashBox};
|
use crate::box_trait::{ResultBox, StringBox, NyashBox};
|
||||||
use crate::boxes::file::FileBox;
|
use crate::boxes::FileBox;
|
||||||
|
|
||||||
impl NyashInterpreter {
|
impl NyashInterpreter {
|
||||||
/// FileBoxのメソッド呼び出しを実行
|
/// FileBoxのメソッド呼び出しを実行
|
||||||
|
|||||||
@ -7,9 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::boxes::null_box::NullBox;
|
use crate::boxes::{NullBox, ConsoleBox, FloatBox};
|
||||||
use crate::boxes::console_box::ConsoleBox;
|
|
||||||
use crate::boxes::math_box::FloatBox;
|
|
||||||
// use crate::boxes::intent_box_wrapper::IntentBoxWrapper;
|
// use crate::boxes::intent_box_wrapper::IntentBoxWrapper;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::boxes::sound_box::SoundBox;
|
use crate::boxes::SoundBox;
|
||||||
use crate::method_box::MethodBox;
|
use crate::method_box::MethodBox;
|
||||||
|
|
||||||
impl NyashInterpreter {
|
impl NyashInterpreter {
|
||||||
|
|||||||
Reference in New Issue
Block a user