refactor(ast): rename value types to Number/Decimal/Text/Boolean
Renamed AST value types for v0.3 naming convention: - Value::Int -> Value::Number - Value::Float -> Value::Decimal - Value::String -> Value::Text - Value::Bool -> Value::Boolean - Expr::IntLit -> Expr::NumberLit - Expr::FloatLit -> Expr::DecimalLit - Expr::StringLit -> Expr::TextLit - Expr::BoolLit -> Expr::BooleanLit Updated all references across parser, resolver, validator, LSP, query engine, tests, and editor.
This commit is contained in:
@@ -106,15 +106,15 @@ fn test_baker_family_field_values() {
|
||||
let martha = project.find_character("Martha").unwrap();
|
||||
|
||||
// Martha sets age: 34 (overriding Person template range 0..100)
|
||||
if let Some(storybook::syntax::ast::Value::Int(age)) = martha.fields.get("age") {
|
||||
if let Some(storybook::syntax::ast::Value::Number(age)) = martha.fields.get("age") {
|
||||
assert_eq!(*age, 34, "Martha's age should be 34");
|
||||
} else {
|
||||
panic!("age should be an Int");
|
||||
panic!("age should be a Number");
|
||||
}
|
||||
|
||||
// Martha sets specialty: "sourdough" (overriding Baker template default
|
||||
// "bread")
|
||||
if let Some(storybook::syntax::ast::Value::String(specialty)) = martha.fields.get("specialty") {
|
||||
if let Some(storybook::syntax::ast::Value::Text(specialty)) = martha.fields.get("specialty") {
|
||||
assert_eq!(
|
||||
specialty, "sourdough",
|
||||
"Martha's specialty should be sourdough"
|
||||
|
||||
Reference in New Issue
Block a user