langur

revision history

A full revision history is included in the download.

2024-05-19 - 0.15.3 - dropped restriction on using number as single token in interpolation - implemented Boolean multiplication with number, string, list, hash, and duration types; return original value if true or zero value if false - changed truthiness of datetime values so that proleptic Gregorian dates (UTC) are false - removed ast.findVariableNames() and ast.AddImpliedParameters() since no longer used - renamed ast.VariableNode as ast.IdentNode - replaced instances of &ast.IdentNode{...} with ast.NewVariableNode(...) 2024-05-12 - 0.15.2 - moved index operation to runframe function - fixed bug (created in 0.15.1) on index out of range error (that is, failed indexing on a langur string, list, or hash treating non-alternate index as alternate index) 2024-05-09 - 0.15.1 - added index by negative integer to index from the "right" (on strings and lists) - added in, of, not in, and not of infix operators (related, but not to be confused with for in or for of loops) - allow writing expansion max as [0..] instead of [0..-1] - removed index range by range (superfluous) - changed indexing operations to use an interface - simplified calling object.Index() and index alternate in compiler and VM (always short-circuiting); dropped opcode.OpIndexAlternate (assimilated into opcode.OpIndex) - edited haskey() to use IIndexable interface - fixed some bugs in regard to counting and using runes in strings instead of bytes 2024-05-05 - 0.15.0 - changed {{interpolation}} syntax; use ni modifier for non-interpolated string or regex; dropped old syntax - added {:} syntax for empty hash literals - changed internal names for conversion functions to match type names exactly - disallowed using {} as string quote markers, such as qs{} or re{} - disallowed token strings from being used as block markers

breaking changes

The current version of langur is very different than the one used in the book opCode v1 (which references langur 0.5).

0.15.3 changed truthiness of datetime values so that proleptic Gregorian dates (UTC) are false

0.15.1 removed index range by range

0.15.0 changed {{interpolation}} syntax; use ni modifier for non-interpolated string or regex; dropped old syntax

0.15.0 disallowed using {} as string quote markers, such as qs{} or re{}

0.15.0 disallowed token strings from being used as block markers

0.14.4 changed parsing functions with parenthesized parameters to require curly braces (long form)

0.14.4 changed datetime formatting variable (string) interpolation; dropped old syntax

0.14.4 dropped old custom function interpolation modifier syntax (deprecated in 0.14.3)

0.14.4 dropped using h token for hashes (deprecated in 0.14.3)

0.14.3 dropped testing list entries for sameness; now checks for equality

0.14.3 changed assignment in if tests to be declarations (not mere assignment)

0.14.2 dropped implied parameter functions

0.14.2 dropped using not as combination operator not=

0.14.2 dropped single letter tokens d, f, q, Q, w, W, x (deprecated in 0.14.1); instead use dr, fn, qs, QS, fw, FW, *

0.14.2 changed truthiness of functions (compiled and built-in) to reflect purity status

0.14.1 updated auto-stringification to only use on certain types (not on lists, hashes, etc.)

0.14.1 changed sleep() function to return a Boolean (false if value less than 1)

0.14.0 dropped matching against regex in swtich without explicit use of forward operator

0.14.0 dropped is and to functions; use type names and is and is not operators instead

0.14.0 dropped old syntax for explicit exception variable on catch; now uses square brackets to enclose, such as catch[.e]

0.13.9 dropped compiler flag -Wlookalike

0.13.8 updated lexing blockquotes to disallow use of ending marker followed other things on same line

0.13.6 dropped given keyword; use switch[and] instead

0.13.6 dropped arr() function; use list multiplication instead

0.13.6 changed truncate() to trunc()

0.13.5 changed isArray() to isList()

0.13.4 drops the X() function; use mapX(fn(... .x) .x, LISTS) instead

0.13.4 changed the cd() function to return the present working directory

0.13.1 changes default conversion of duration to string to include P

0.13.0 requires explicit declaration for impure functions. It also puts restrictions on their use. See the functions page for more details.

0.13.0 changes durations to both use their own token (not the date-time token) and makes them objects.

0.13.0 removes non-list functionality from gcd() and lcm()

0.12.7 changes the return value types on write(), writeln(), writeErr(), writelnErr()

0.12.7 drops deprecated execTh() syntax

0.12.6 changes the default "now" to not include nanoseconds

0.12.6 changes execTh() to execTH() and deprecates using execTh()

0.12.5 adds new syntax for alternate operator between case conditions, such as case[and]; 0.12.6 removes old syntax

0.12.4 changes truthiness checking for numbers, strings, regexes, and ranges

0.12.4 drops the to token ; use .. instead

0.12.4 drops the toBool() and toBoolOrNull() functions

0.12.2 changes the ZLS token to zls

0.12.0 swaps operator precedence for exponents and prefix minus.

0.12.0 drops escape codes \N, \P, and \L.

0.11.4 makes curly braces on catch no longer optional.

0.11.2 changed where() to filter() (deprecated use of where()) and dropped superfluous built-in function bestTag()

0.11.1 changes the name of the default rounding mode to "half away from 0" to match what it actually does.

0.11 changes default rounding to round half away from zero.

0.11 drops likely superfluous functions best(), bestkey(), good(), and wherekeys().

0.10 changes parsing multi-variable assignment in 2 ways (limited to statement context or tests of if expressions, and no longer uses parentheses).

0.10 disallows declarations in given test expressions, but no one will miss it.

0.10 removes break with value not using assignment operator (deprecated in 0.9.6).

0.10 removes using explicitly negated modifiers, as no longer necessary (deprecated in 0.9.4).

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 list first, then false list 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/switch 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.