From 645105c2c54fd5c26c9a8e928e2627377d6327ee Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Thu, 26 Sep 2024 10:47:53 -0700 Subject: [PATCH] Remove kebab-case from parser. It was not being used. This is a simple one. It does not make sense for an infix language that uses `-` as a first-class binary (and more importantly, unary) operator. I liked the idea, but I don't think it was going to work. Plus, I wasn't using it for builtin functions in the first place, so why keep it around? Underscores are just fine for our purposes. Signed-off-by: Alek Ratzloff --- src/parser.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser.rs b/src/parser.rs index 146f955..017b522 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -40,7 +40,7 @@ impl Display for ParseError { const WHITESPACE: &str = " \t\r"; const NAME_START_CHARS: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"; -const NAME_CHARS: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789-"; +const NAME_CHARS: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"; const NUMBER_START_CHARS: &str = "0123456789"; const NUMBER_CHARS: &str = "0123456789."; const NUMBER_HEX_CHARS: &str = "0123456789ABCDEFabcdef"; @@ -867,13 +867,13 @@ macro_rules! lexer_check { #[test] fn test_lexer_names() { - let input = "asdf fdsa the-quick-brown-fox jumped_over-the-lazy_dogs"; + let input = "asdf fdsa the_quick_brown_fox jumped_over_the_lazy_dogs"; let mut lexer = Lexer::new(input.to_string(), ":testing:"); lexer_check!(lexer, TokenKind::Name, "asdf"); lexer_check!(lexer, TokenKind::Name, "fdsa"); - lexer_check!(lexer, TokenKind::Name, "the-quick-brown-fox"); - lexer_check!(lexer, TokenKind::Name, "jumped_over-the-lazy_dogs"); + lexer_check!(lexer, TokenKind::Name, "the_quick_brown_fox"); + lexer_check!(lexer, TokenKind::Name, "jumped_over_the_lazy_dogs"); assert!(lexer.is_eof()); }