std/path/z/context

Standard Library documentation

Evaluation context used by std/path/z.

Module

Name
std/path/z/context
Area
Standard Library
Source
modules/std/path/z/context.zzm

NAME

std/path/z/context - Evaluation context used by std/path/z.

IMPLEMENTATION SUPPORT

This module is supported by all implementations of ZuzuScript.

DESCRIPTION

This module provides the pure-Zuzu evaluation context used by ZPath.

EXPORTS

Classes

  • Ctx({ root, nodeset?, parentset?, meta? })

    Constructs a ZPath evaluation context. Returns: Ctx. Wraps root as a std/path/z/node Node and stores the active node sets.

    • ctx.with_nodeset(ns, ps)

      Parameters: ns is the next node set and ps is the parent set. Returns: Ctx. Returns a copy of the context with different node sets.

    • ctx.nested(extras?)

      Parameters: extras is optional metadata. Returns: Ctx. Returns a nested context with incremented metadata level.

    • ctx.root()

      Parameters: none. Returns: Node. Returns the root node.

    • ctx.nodeset()

      Parameters: none. Returns: Array. Returns the current node set.

    • ctx.parentset()

      Parameters: none. Returns: Array or null. Returns the parent node set.

    • ctx.meta()

      Parameters: none. Returns: Dict. Returns context metadata.

COPYRIGHT AND LICENCE

std/path/z/context is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.