refactor(lexer): rename value type tokens for v0.3

Renamed lexer tokens to align with new v0.3 naming convention:
- IntLit -> NumberLit
- FloatLit -> DecimalLit
- StringLit -> TextLit

Updated all references across parser grammar, property tests,
and editor highlighting.
This commit is contained in:
2026-02-14 13:58:46 +00:00
parent 4e4e5500b0
commit 8c3c380cfd
6 changed files with 68 additions and 68 deletions

View File

@@ -244,16 +244,16 @@ Field: Field = {
};
Value: Value = {
<IntLit> => Value::Int(<>),
<FloatLit> => Value::Float(<>),
<StringLit> => Value::String(<>),
<NumberLit> => Value::Int(<>),
<DecimalLit> => Value::Float(<>),
<TextLit> => Value::String(<>),
<BoolLit> => Value::Bool(<>),
"any" => Value::Any,
<lo:IntLit> ".." <hi:IntLit> => Value::Range(
<lo:NumberLit> ".." <hi:NumberLit> => Value::Range(
Box::new(Value::Int(lo)),
Box::new(Value::Int(hi))
),
<lo:FloatLit> ".." <hi:FloatLit> => Value::Range(
<lo:DecimalLit> ".." <hi:DecimalLit> => Value::Range(
Box::new(Value::Float(lo)),
Box::new(Value::Float(hi))
),
@@ -572,14 +572,14 @@ DecoratorRepeat: BehaviorNode = {
};
DecoratorRepeatN: BehaviorNode = {
"repeat" "(" <n:IntLit> ")" "{" <child:BehaviorNode> "}" => BehaviorNode::Decorator {
"repeat" "(" <n:NumberLit> ")" "{" <child:BehaviorNode> "}" => BehaviorNode::Decorator {
decorator_type: DecoratorType::RepeatN(n as u32),
child: Box::new(child),
},
};
DecoratorRepeatRange: BehaviorNode = {
"repeat" "(" <min:IntLit> ".." <max:IntLit> ")" "{" <child:BehaviorNode> "}" => BehaviorNode::Decorator {
"repeat" "(" <min:NumberLit> ".." <max:NumberLit> ")" "{" <child:BehaviorNode> "}" => BehaviorNode::Decorator {
decorator_type: DecoratorType::RepeatRange(min as u32, max as u32),
child: Box::new(child),
},
@@ -593,7 +593,7 @@ DecoratorInvert: BehaviorNode = {
};
DecoratorRetry: BehaviorNode = {
"retry" "(" <n:IntLit> ")" "{" <child:BehaviorNode> "}" => BehaviorNode::Decorator {
"retry" "(" <n:NumberLit> ")" "{" <child:BehaviorNode> "}" => BehaviorNode::Decorator {
decorator_type: DecoratorType::Retry(n as u32),
child: Box::new(child),
},
@@ -949,9 +949,9 @@ InequalityOp: CompOp = {
};
Literal: Expr = {
<IntLit> => Expr::IntLit(<>),
<FloatLit> => Expr::FloatLit(<>),
<StringLit> => Expr::StringLit(<>),
<NumberLit> => Expr::IntLit(<>),
<DecimalLit> => Expr::FloatLit(<>),
<TextLit> => Expr::StringLit(<>),
<BoolLit> => Expr::BoolLit(<>),
};
@@ -1037,9 +1037,9 @@ extern {
// Literals
Ident => Token::Ident(<String>),
IntLit => Token::IntLit(<i64>),
FloatLit => Token::FloatLit(<f64>),
StringLit => Token::StringLit(<String>),
NumberLit => Token::NumberLit(<i64>),
DecimalLit => Token::DecimalLit(<f64>),
TextLit => Token::TextLit(<String>),
TimeLit => Token::TimeLit(<String>),
DurationLit => Token::DurationLit(<String>),
ProseBlockToken => Token::ProseBlock(<ProseBlock>),