Skip to content

Releases: yasl-lang/yasl

v0.13.5

01 Apr 02:50
ef0f3e7
Compare
Choose a tag to compare

New Features:

  • Added try function to allow recovery from errors.
  • Add package.searchpath, to allow us to see what files we attempt to open with require.
  • Add list->shuffle, to allow randomly reordering a list.
  • Add list->has, str->has, and set->has for checking membership.

Bug Fixes:

  • Slicing with invalid range now correctly shows error message instead of crashing.
  • Fixed bug with str->replace(str, str, int) incorrectly not doing enough replacements.
  • table->copy now correctly copies the metatable.

C API:

  • Add YASLX_checknoptstrz, for checking for str/undef and filling in a default value.
  • Deprecate YASL_popcstr, YASL_peekuserdata, and YASL_popuserdata.

Internal Changes:

  • Most strs are now interned.

v0.13.4

28 Feb 03:27
99d8e0c
Compare
Choose a tag to compare

New Features:

  • Add str.isupper and str.islower.
  • Allow list.sort(fn), for sorting with a custom function.
  • Add io.tmpfile.

Bug Fixes:

  • str.count('') now returns the string length + 1.
  • str.split('', int) is now correctly an error.
  • str.split(0) now correctly handles leading whitespace.
  • Fix bug with io.write crashing.

v0.13.3

23 Feb 04:16
3b603ac
Compare
Choose a tag to compare

New Features:

  • Add os.command, for running shell commands directly from YASL.
  • Add os.clock, for getting approximate time since program start.
  • Add os.getenv, for loading environment variables from YASL.

Bug Fixes:

  • Correctly handle syntax errors with variables declared using -D flag.
  • str.split(int) now correctly returns a list of length 1 when no splits occur.
  • str.split(int) now correctly handles whitespace after the last split.
  • str.split(0) no longer returns an empty list.

C API:

  • Add YASLX_print_value_err.
  • Add YASLX_print_err_bad_arg_type_n, to cut down on boilerplate with YASLX_print_err_bad_arg_type.
  • Add YASLX_throw_value_err and YASLX_throw_type_err, to cut down on boilerplate with YASL_throw_err.
  • Add YASLX_checknoptint, YASLX_checknoptfloat, YASLX_checknoptbool for checking if a value is the specific type or undef.
  • Add YASL_checknstr.

v0.13.2

13 Feb 02:33
e6b200d
Compare
Choose a tag to compare

Bug Fixes:

  • Fixed bug introduced in v0.13.1 that caused incorrect handling of commandline arguments.
  • Fixed crash when there is a syntax error while using the -D flag.
  • Added function declarations for a few missing functions in yasl.h.

v0.13.1

04 Feb 19:00
c1f4027
Compare
Choose a tag to compare

New Features:

  • Allow formatting of expressions in interpolated strings.
  • Allow defining global variables from the command line with the -D flag.

Bug Fixes:

  • YASL_callfunction now works correctly with YASL functions (rather than only with C ones).
  • return in the body of a match in a variadic function now works correctly.
  • Fixed bug with comparison operators causing a crash when used with list, table, and set literals.

v0.13.0

29 Apr 17:53
6ea631a
Compare
Choose a tag to compare

Breaking Changes:

  • Add asserts to validate that global variables are valid YASL identifiers (previously allowed any string, which would be impossible to use if not a valid YASL identifier).
  • list->search now looks from start of list (previously, looked from end due to bug).
  • . no longer looks in the metatable.
  • collections.table no longer adds an extra undef, instead it removes the last argument, so it matches with the literal table constructors better.
  • (variadic) (a variadic pack surrounded by parentheses) now decays to a single expression.
  • Short lambdas fn(...) -> ... no longer allow parentheses around the return for variadics.
  • Only allow looking up metatables via mt.get for table, list, and userdata.
  • Iteration now uses in instead of <-.

New Features:

  • Add int->tochar and str->tobyte functions, to allow turning numeric codes to strings and vice-versa (e.g. a -> 97 and vice-versa).
  • Add 'r', 'd', 'x', and 'b' formats for int->tostr.
  • Add 'r' format to str->tostr.
  • Forward format args for list->tostr, set->tostr, and table->tostr to their elements.
  • Add str->isprint function to check for printable characters.

C API:

  • Add YASLX_tablesetfunctions to allow adding multiple functions at once to a table from C.

Bug Fixes:

  • YASLX_checknint and YASLX_checknfloat now correctly print out the type of the incorrect argument (previously, they always printed the type of the top of the stack).
  • Fix bug with writing str containing '\0' to a file (previously, we used the C function strlen for this, resulting in incorrectly writing too short of a length).

Other Changes:

  • Allow pure, consteval, constexpr, constfold and yield as identifier names (previously, they were reserved).

v0.12.4

15 Apr 00:27
b3fe15e
Compare
Choose a tag to compare

Bug Fixes:

  • Fix Unicode output on Windows.

v0.12.3

04 Apr 03:03
25f5bdc
Compare
Choose a tag to compare

New Features:

  • Add max_splits argument to str.split, to allow only splitting up to a certain number of times.
  • Add mt.setself function.
  • Add mt.lookup function.

Bug Fixes:

  • Fixes bug where comprehension not used as the only expression on the stack produced wrong result.
  • Fix handling of files using only LF on Windows.

Internal Changes:

  • Update tests to use mt.lookup.

v0.12.2

08 Nov 04:17
fabe78a
Compare
Choose a tag to compare

New Features:

  • Added ifdef and elseifdef to allow checking if a name has been declared.
  • Allow bitwise operators (|, &, &^, ^) to be used with boolean operands.

Bug Fixes:

  • Indexing str with a negative index that is out of bounds now gives a proper error message.

v0.12.1

08 Nov 04:15
858c7dc
Compare
Choose a tag to compare

Bug Fixes:

  • Fix crash when closure is created inside of a loop.