class BELParser::Language::Syntax::InvalidFunction

InvalidFunction represents a syntax error with invalid function name according to a BEL specification.

Public Class Methods

map(func_node, spec, _namespaces) click to toggle source
# File lib/bel_parser/language/syntax/invalid_function.rb, line 13
def self.map(func_node, spec, _namespaces)
  return nil unless func_node.is_a?(BELParser::Parsers::AST::Function)

  function_name =
    if func_node.identifier
      func_node.identifier.string_literal
    else
      ''
    end
  unless spec.function(function_name.to_sym)
    InvalidFunctionSyntaxError.new(func_node, spec, function_name)
  end
end