expr

    expr command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.2
    License
    Apache-2.0
    Last updated
    10 hours ago
    Downloads
    73

    #expr

    Evaluate integer and string expressions for MoonX.

    moonx cli/expr@0.2.2 EXPRESSION

    #Supported scope

    Pass operators and operands separately. Supports arbitrary-size integer arithmetic, comparisons, logical operators, anchored BRE matching and string functions.

    #Options

    OptionDescription
    EXPRESSIONOperators: |, &, comparisons, +, -, *, /, %, : and parentheses.
    match / substr / index / lengthString functions using byte positions.
    + ARGTreat the next argument literally.
    --help / --versionShow help / package version.

    #Limitations

    • String operations and matching use C-byte rules, not locale-aware characters.
    • Exit 0 for nonempty/nonzero, 1 for empty/zero, and 2 for invalid expressions.

    #Examples

    moonx cli/expr@0.2.2 2 + 3 moonx cli/expr@0.2.2 length example

    Parser

    type Parser

    Source Files

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io