std/path/z/operators

Standard Library documentation

Operator definitions for ZPath.

Module

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

NAME

std/path/z/operators - Operator definitions for ZPath.

IMPLEMENTATION SUPPORT

This module is supported by all implementations of ZuzuScript.

DESCRIPTION

This module defines the base ZPath operator model and the standard operator table used by std/path/z.

EXPORTS

Traits

  • EvalHelpers

    Shared helpers for operator and function definitions.

    • helper.wrap(value)

      Parameters: value is any value. Returns: Array. Wraps value as a one-item ZPath node array.

    • helper.wrap_for_array(value)

      Parameters: value is any value. Returns: Node. Wraps value as a ZPath node for array results.

Classes

  • Operator({ spelling: String, kind: String, precedence: Number, ... })

    Constructs an operator definition. Returns: Operator.

    • operator.is_unary(), operator.is_binary()

      Parameters: none. Returns: Boolean. Reports whether the operator is unary or binary.

    • operator.requires_whitespace()

      Parameters: none. Returns: Boolean. Reports whether the lexer requires whitespace around the operator.

    • operator.lexer_should_ignore()

      Parameters: none. Returns: Boolean. Reports whether the lexer should ignore this operator definition.

    • operator.is_right_associative()

      Parameters: none. Returns: Boolean. Reports whether the operator is right associative.

    • operator.char_length()

      Parameters: none. Returns: Number. Returns the operator spelling length.

    • operator.precedence_is(lvl)

      Parameters: lvl is a precedence level. Returns: Boolean. Returns true when the operator has that precedence.

Constants

  • STANDARD_OPERATORS

    Type: Array. Standard ZPath operator definitions.

COPYRIGHT AND LICENCE

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