@dallaylaen/ski-interpreter
    Preparing search index...

    Function toposort

    • Topologically sort a list of terms, extending it with any missing dependency terms, if necessary. The output list is guaranteed to contain at least the input terms.

      Parameters

      • options: {
            allow?: Record<string, Named>;
            env?: Record<string, Named>;
            list?: Expr | Expr[];
        }
        • Optionalallow?: Record<string, Named>

          a set of terms that are allowed in the returned list (aside from the input list).

        • Optionalenv?: Record<string, Named>

          a set of terms assumed to be known (and thus not required in the output list).

        • Optionallist?: Expr | Expr[]

          a single expression or a list of expressions to sort.

      Returns ToposortResult

      const expr = ski.parse(src);
      toposort([expr], ski.getTerms()); // returns all terms appearing in Expr in correct order