From b3e07b710e9a09e5bad63c23aa4e263a647832e7 Mon Sep 17 00:00:00 2001 From: PaddiM8 Date: Thu, 11 Jun 2020 21:47:14 +0200 Subject: [PATCH] Renamed symbol_table::contains_func to contains_fn. --- kalk/src/parser.rs | 2 +- kalk/src/symbol_table.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kalk/src/parser.rs b/kalk/src/parser.rs index 157eca5..568709b 100644 --- a/kalk/src/parser.rs +++ b/kalk/src/parser.rs @@ -255,7 +255,7 @@ fn parse_identifier(context: &mut Context) -> Result { // Eg. sqrt64 if match_token(context, TokenKind::Literal) { // If there is a function with this name, parse it as a function, with the next token as the argument. - if context.symbol_table.contains_func(&identifier.value) { + if context.symbol_table.contains_fn(&identifier.value) { let parameter = Expr::Literal(advance(context).value.clone()); return Ok(Expr::FnCall(identifier.value, vec![parameter])); } diff --git a/kalk/src/symbol_table.rs b/kalk/src/symbol_table.rs index 094da65..a8df17e 100644 --- a/kalk/src/symbol_table.rs +++ b/kalk/src/symbol_table.rs @@ -32,7 +32,7 @@ impl SymbolTable { prelude::CONSTANTS.contains_key(identifier) || self.hashmap.contains_key(identifier) } - pub fn contains_func(&self, identifier: &str) -> bool { + pub fn contains_fn(&self, identifier: &str) -> bool { prelude::UNARY_FUNCS.contains_key(identifier) || prelude::UNARY_FUNCS.contains_key(identifier) || self.hashmap.contains_key(&format!("{}()", identifier))