Recursively compare two AST objects to identify structural and value differences. Useful for debugging changes in model structure or equation transformations.
Value
A list with:
- identical
Logical, TRUE if ASTs are identical
- differences
data.frame with columns: path, field, value1, value2
- summary
Character string summarizing key differences
Examples
if (FALSE) { # \dontrun{
# Compare two equation ASTs
eq1 <- model_old$equations$eqTechCap
eq2 <- model_new$equations$eqTechCap
result <- compare_ast(eq1, eq2)
print(result)
# Compare specific parts
result <- compare_ast(eq1$rhs, eq2$rhs, path = "eqTechCap$rhs")
} # }
