@samatawy/rules
    Preparing search index...

    Class FunctionParser

    Parser class for parsing function syntax into CustomFunctionExpression objects. You should normally not need to use this parser directly, as it is primarily used internally when creating functions from syntax. This parser handles parsing of custom functions with parameters and a body expression. The parser uses regular expressions to identify the structure of the function syntax and delegates to the ExpressionParser for parsing specific components of the function (like the body expression). The parser is designed to be extensible, allowing for additional function types and syntax patterns to be added in the future as needed.

    Index

    Constructors

    Methods

    • Parse a function definition from its syntax string and return the corresponding FunctionDefinition object.

      Parameters

      • syntax: string

        The syntax string of the function to parse.

      Returns FunctionDefinition | null

      The parsed FunctionDefinition object if successful, null otherwise.

      An error if the syntax is unrecognized or invalid, or if the function name is reserved.