Yog Script (.ys, .yns) analyzed: its lexer, parser and syntax tree, names resolved, the class index model — what the build and the editors read a source with.
usesuper::*;#[test]fnconversions_follow_the_grammar(){assert!(Type::I32.converts_to(&Type::F64));assert!(!Type::F64.converts_to(&Type::I32));assert!(Type::Null.converts_to(&Type::own("Player").nullable()));assert!(!Type::Null.converts_to(&Type::own("Player")));assert!(Type::I32.converts_to(&Type::I32.nullable()));// Real time and the game's never mix: its tick rate changes.
assert!(!Type::Unit(SECONDS.into()).converts_to(&Type::Unit(TICKS.into())));assert!(!Type::Unit(TICKS.into()).converts_to(&Type::Unit(SECONDS.into())));assert!(!Type::Unit(TICKS.into()).converts_to(&Type::Unit(BLOCKS.into())));assert!(!Type::Bool.converts_to(&Type::I32));assert!(Type::Unknown.converts_to(&Type::Bool));assert_eq!(Type::Array(Box::new(Type::I32.nullable()),1).to_string(),"i32?[]");}