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

@@ -89,9 +89,9 @@ impl iced::widget::text::Highlighter for StorybookHighlighter {
match &token {
| Token::Colon => after_colon = true,
| Token::Ident(_) |
Token::IntLit(_) |
Token::FloatLit(_) |
Token::StringLit(_) |
Token::NumberLit(_) |
Token::DecimalLit(_) |
Token::TextLit(_) |
Token::True |
Token::False |
Token::TimeLit(_) |

View File

@@ -88,10 +88,10 @@ pub fn token_to_color(token: &Token) -> Color {
| Token::Ident(_) => Color::from_rgb8(0x50, 0xfa, 0x7b), // Bright green
// Number literals - Bright Purple
| Token::IntLit(_) | Token::FloatLit(_) => Color::from_rgb8(0xbd, 0x93, 0xf9), /* Light purple */
| Token::NumberLit(_) | Token::DecimalLit(_) => Color::from_rgb8(0xbd, 0x93, 0xf9), /* Light purple */
// String literals - Vibrant Yellow/Gold
| Token::StringLit(_) => Color::from_rgb8(0xf1, 0xfa, 0x8c), // Bright yellow
// Text literals - Vibrant Yellow/Gold
| Token::TextLit(_) => Color::from_rgb8(0xf1, 0xfa, 0x8c), // Bright yellow
// Time/duration literals - Bright Teal
| Token::TimeLit(_) | Token::DurationLit(_) => Color::from_rgb8(0x66, 0xd9, 0xef), /* Bright teal */
@@ -193,12 +193,12 @@ mod tests {
// Strings should be green
assert_eq!(
token_to_color(&Token::StringLit("test".to_string())),
token_to_color(&Token::TextLit("test".to_string())),
Semantic::SUCCESS
);
// Numbers should be gold (lighter)
assert_eq!(token_to_color(&Token::IntLit(42)), Gold::_400);
assert_eq!(token_to_color(&Token::NumberLit(42)), Gold::_400);
// Identifiers should be warm gray
assert_eq!(