mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-23 19:21:26 +02:00
Renamed symbol_table::contains_func to contains_fn.
This commit is contained in:
parent
4fbb71f423
commit
ffd26c1da9
@ -255,7 +255,7 @@ fn parse_identifier(context: &mut Context) -> Result<Expr, CalcError> {
|
||||
// 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]));
|
||||
}
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user