Phase 12.7: Nyash文法革命とANCP 90%圧縮技法の発見 - 文法改革完了とFunctionBox実装

This commit is contained in:
Moe Charm
2025-09-03 20:03:45 +09:00
parent 6d79d7d3ac
commit 7455c9ec97
69 changed files with 3817 additions and 62 deletions

View File

@ -0,0 +1,17 @@
use crate::parser::NyashParser;
use crate::ast::ASTNode;
#[test]
fn parse_parent_colon_syntax() {
let src = "Parent::birth()";
let ast = NyashParser::parse_from_string(src).expect("parse ok");
fn is_fromcall(n: &ASTNode) -> bool {
match n {
ASTNode::FromCall { parent, method, .. } => parent == "Parent" && method == "birth",
ASTNode::Program { statements, .. } => statements.iter().any(is_fromcall),
_ => false,
}
}
assert!(is_fromcall(&ast));
}