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:
2026-02-14 14:03:21 +00:00
parent 8c3c380cfd
commit 8e4bdd3942
21 changed files with 188 additions and 188 deletions

View File

@@ -83,7 +83,7 @@ pub fn validate_no_reserved_keywords(fields: &[Field], collector: &mut ErrorColl
pub fn validate_trait_ranges(fields: &[Field], collector: &mut ErrorCollector) {
for field in fields {
match &field.value {
| Value::Float(f) => {
| Value::Decimal(f) => {
// Normalized trait values should be 0.0 .. 1.0
if (field.name.ends_with("_normalized") ||
field.name == "bond" ||
@@ -99,7 +99,7 @@ pub fn validate_trait_ranges(fields: &[Field], collector: &mut ErrorCollector) {
});
}
},
| Value::Int(i) => {
| Value::Number(i) => {
// Age should be reasonable
if field.name == "age" && (*i < 0 || *i > 150) {
collector.add(ResolveError::TraitOutOfRange {
@@ -120,7 +120,7 @@ pub fn validate_relationship_bonds(relationships: &[Relationship], collector: &m
for rel in relationships {
for field in &rel.fields {
if field.name == "bond" {
if let Value::Float(f) = field.value {
if let Value::Decimal(f) = field.value {
if !(0.0..=1.0).contains(&f) {
collector.add(ResolveError::TraitOutOfRange {
field: "bond".to_string(),
@@ -457,12 +457,12 @@ mod tests {
let fields = vec![
Field {
name: "bond".to_string(),
value: Value::Float(0.8),
value: Value::Decimal(0.8),
span: Span::new(0, 10),
},
Field {
name: "age".to_string(),
value: Value::Int(30),
value: Value::Number(30),
span: Span::new(0, 10),
},
];
@@ -476,7 +476,7 @@ mod tests {
fn test_invalid_bond_value_too_high() {
let fields = vec![Field {
name: "bond".to_string(),
value: Value::Float(1.5),
value: Value::Decimal(1.5),
span: Span::new(0, 10),
}];
@@ -489,7 +489,7 @@ mod tests {
fn test_invalid_bond_value_negative() {
let fields = vec![Field {
name: "bond".to_string(),
value: Value::Float(-0.1),
value: Value::Decimal(-0.1),
span: Span::new(0, 10),
}];
@@ -502,7 +502,7 @@ mod tests {
fn test_invalid_age_negative() {
let fields = vec![Field {
name: "age".to_string(),
value: Value::Int(-5),
value: Value::Number(-5),
span: Span::new(0, 10),
}];
@@ -515,7 +515,7 @@ mod tests {
fn test_invalid_age_too_high() {
let fields = vec![Field {
name: "age".to_string(),
value: Value::Int(200),
value: Value::Number(200),
span: Span::new(0, 10),
}];
@@ -531,7 +531,7 @@ mod tests {
participants: vec![],
fields: vec![Field {
name: "bond".to_string(),
value: Value::Float(0.9),
value: Value::Decimal(0.9),
span: Span::new(0, 10),
}],
span: Span::new(0, 100),
@@ -549,7 +549,7 @@ mod tests {
participants: vec![],
fields: vec![Field {
name: "bond".to_string(),
value: Value::Float(1.2),
value: Value::Decimal(1.2),
span: Span::new(0, 10),
}],
span: Span::new(0, 100),