langur

download

Compiling langur 0.9 also requires the following (see installation instructions).

As of 0.8, it is no longer necessary to use the decNumber library and CGo wrapper, as it has been replaced with a slightly modified version of shopspring/decimal, a native Go library with arbitrary precision.

Compiling langur 0.7 or earlier also requires the following (see installation instructions).

revision history

A full revision history is included in the download.

2020-04-02 - 0.9.3 - added date-time interpolation modifier - added literal to get current date-time in a specified time zone (may be either offset or may be Z for UTC) - fully incorporated the regexp package (see REGEXP_README.md) - added free-spacing mode to re2 - added esc modifier for re2 literals to escape all interpolations (instead of adding a modifier to each interpolation) - allowed an ending block quote marker to be spaced from the beginning of the line with tabs and spaces - standardized the result of group() when called with 1 argument (by truthiness) to always put true array first, then false array second, even if one or both is empty 2020-03-26 - 0.9.2 - revised toNumber() function to return Unix nanoseconds from a date-time, rather than seconds - revised console output functions to output date-time value without dt// tokens - updated keys() function to return array [1, 2] for a range 2020-03-26 - 0.9.1 - simplified lexing short-hand indexing by string - fixed parsing nil left partially implied functions such as f{-7} (looks like a negative number) - removed now unnecessary check for illegal use of semicolon in lists - removed now unnecessary check for parser levels and made small changes to accompany that - other lexer/parser clean up 2020-03-25 - 0.9.0 - limited declaration expression context to statement or to if/given expression tests ... which means that fewer things can create variable scope and this potentially reduces confusion - fixed / clarified parsing statement lists vs. expression lists - added date-time objects/literals literal syntax using a subset of ISO 8601, extended format only - added isDateTime() function - updated toHash() to convert a date-time to a hash and toString() to generate a timestamp or other date/time string, and toNumber() to generate a number representing Unix seconds (not nanoseconds) since January 1, 1970 UTC - added short-hand indexing by string using single quote mark on a variable; is limited to token code points ex.: .abc'123 == .abc["123"] - added combination prefix operators not= and not?= - updated group(), all(), and any() functions to accept a single argument (test by truthiness) - added compiler check for expression on deciding whether to short-circuit an index alternate (statements, if allowed, must short-circuit there); This is not to say that statements are allowed in the alternate section (determined by the parser). - renamed ast.InlineDeclarationNode as ast.LineDeclarationNode to reflect it's more limited context - added *ast.LineDeclarationNode and *ast.AssignmentNode to the search for implied parameters - changed type string for COMPILED_CODE to COMPILED and BUILTIN_FUNCTION to BUILTIN - added check for HasScope in ast.SimplifyNode()

breaking changes

0.9.3 allows an ending block quote marker to be spaced from the beginning of the line with tabs and spaces. It also standardizes the result of group() when called with 1 argument (by truthiness) to always put true array first, then false array second.

0.9.2 returns nanoseconds, not seconds, from toNumber() when passed a date-time.

0.9 limits declaration expression context to statement or to if/given expression tests.

0.8.4 changes the default of base and hex interpolation modifiers to pad with spaces; precede the number with 0 to pad with zeroes. 0.8.4 also fixes padding counts for interpolation modifiers to include the sign, if one present.

0.8 changes the 1 part for loop (test only) to a while loop, with implicit loop variable _while.

0.8 changes the decimal implementation from a fixed 34 digit precision to an "arbitrary precision" decimal. The following changes were also made.

0.7 changes the implicit exception variable from .err to _err.

0.7 removes the use of carriage return/line feed combination for new lines in source code (deprecated since 0.6.8). Use ASCII line feed only ("Linux new line").

0.7 evaluates complex test expressions for given expressions once instead of on every case. This is both more efficient and convenient.

0.6 disallows anything but a variable to be used as a lone token in an interpolation.

license

Langur uses the Apache license 2.0.

The Go wrapper for decNumber and the decNumber library use an ICU license, which is included with the download.