From 80ea0d650e3d8f56e43df21f1293b4ddccb89203 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Wed, 26 Nov 2025 19:13:45 +1300 Subject: Remove semantic::ListLiteral::Invocation This variant was never needed or constructed, I would have added it to match the invocation variants of the block and integer tokens (which do have a use). --- src/stages/compiler.rs | 3 --- src/stages/intermediate.rs | 16 ---------------- src/stages/semantic_tokens.rs | 4 ---- 3 files changed, 23 deletions(-) diff --git a/src/stages/compiler.rs b/src/stages/compiler.rs index b4680c2..bc86589 100644 --- a/src/stages/compiler.rs +++ b/src/stages/compiler.rs @@ -252,9 +252,6 @@ impl SymbolParser { fn parse_list_token(&mut self, token: &ListToken, source: &SourceSpan) { match &token { - ListToken::Invocation(invocation) => { - self.parse_invocation(&invocation, source) - } ListToken::ListLiteral(integers) => { for integer in integers { self.parse_integer_token(&integer, source) diff --git a/src/stages/intermediate.rs b/src/stages/intermediate.rs index 8cabe26..3dfa0fd 100644 --- a/src/stages/intermediate.rs +++ b/src/stages/intermediate.rs @@ -314,9 +314,6 @@ impl IntermediateParser { } Some(Tracked::from(integers, source.clone())) } - ListToken::Invocation(invocation) => { - self.parse_list_invocation(&invocation, source) - } } } @@ -348,19 +345,6 @@ impl IntermediateParser { } } - fn parse_list_invocation(&mut self, invocation: &Invocation, source: &SourceSpan) -> Option> { - let result = self.parse_invocation(invocation, source)?; - let source = result.source; - match result.value { - IntermediateValue::List(literal) => Some(Tracked::from(literal, source)), - IntermediateValue::Integer(_) | IntermediateValue::Block(_) => { - let error = IntermediateError::ExpectedList; - self.errors.push(Tracked::from(error, source)); - None - } - } - } - fn parse_invocation(&mut self, invocation: &Invocation, source: &SourceSpan) -> Option> { let received_count = invocation.arguments.len(); let signature = SymbolSignature { diff --git a/src/stages/semantic_tokens.rs b/src/stages/semantic_tokens.rs index 69c6c98..89a5b37 100644 --- a/src/stages/semantic_tokens.rs +++ b/src/stages/semantic_tokens.rs @@ -84,7 +84,6 @@ pub enum BlockToken { pub enum ListToken { StringLiteral(StringLiteral), ListLiteral(Vec>), - Invocation(Invocation), } #[derive(Clone)] @@ -353,9 +352,6 @@ fn print_list_token(i: usize, string: &ListToken) { print_integer_token(i+1, integer); } } - ListToken::Invocation(invocation) => { - print_invocation(i, invocation) - } } } -- cgit v1.2.3-70-g09d2