std/path/zz

Standard Library documentation

ZuzuScript-flavoured path selectors.

Module

Name
std/path/zz
Area
Standard Library
Source
modules/std/path/zz.zzm

NAME

std/path/zz - ZuzuScript-flavoured path selectors.

SYNOPSIS

  from std/path/zz import ZZPath;

  let data := { users: [ { name: "Ada" } ] };
  say( ( new ZZPath( path: "/users/#0/name" ) ).first(data) );

IMPLEMENTATION SUPPORT

This module is supported by all implementations of ZuzuScript.

DESCRIPTION

This module provides the public ZZPath class. It currently reuses the ZPath traversal, parser, lexer, assignment, and reference machinery while routing expression operators through std/path/zz/operators and expression functions through std/path/zz/functions.

EXPORTS

Classes

  • ZZEvaluator

    Evaluator class that supplies ZZPath operators and functions.

    • evaluator.operator_definitions()

      Parameters: none. Returns: Array. Returns ZZPath operator definitions.

    • evaluator.function_definitions()

      Parameters: none. Returns: Array. Returns ZZPath function definitions.

  • ZZPath({ path: String })

    Constructs a ZZPath query object. Returns: ZZPath. Inherits the public query, assignment, and reference methods from ZPath.

    • path.get_evaluator()

      Parameters: none. Returns: ZZEvaluator. Returns the evaluator used for this path.

    • node.find(path)

      ZZPath inherits from ZPath, so a ZZPath object can be passed to std/path/z/node Node.find().

COPYRIGHT AND LICENCE

std/path/zz 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.