Releases: yasl-lang/yasl
Releases · yasl-lang/yasl
v0.13.7
New features:
- Allow pattern matching on multiple values.
- Add
io.setformat, which allows us to set a default format for allechostatements. - Add
str->partition. - Add format option for
echo. - Allow
=syntax intables. - Add
'b'option tobool->tostr. - Add
bool->tobyte. - Add
table->setdefault.
C API:
- Add function to allow us to disable
echofrom the C API. - Add
YASL_getvargsstartto get us the starting index of the variadic arguments. - Add
YASL_floattostrto convert floats to string in the same way asfloat->tostr.
v0.13.6
New Features:
list->searchandstr->searchnow takes an additional optional parameter (the starting position).str->searchnow returns the end position of the foundstr(as well as the start).- Allow no trailing new line at end of files.
- Add
evalfunction. - Add
math.log2andmath.log10.
Bug Fixes:
- Fix bug with calling
str->trim(whitespace). - Clean up how
iohandles files with newlines on Windows. - Fix error messages for all
boolmethods. - Fix error where ref counting in upvals was not done correctly in some cases.
Internal Changes:
- Clean up directory structure
- Clean up tests for errors
- Start preliminary work on GC.
v0.13.5
New Features:
- Added
tryfunction to allow recovery from errors. - Add
package.searchpath, to allow us to see what files we attempt to open withrequire. - Add
list->shuffle, to allow randomly reordering alist. - Add
list->has,str->has, andset->hasfor 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->copynow correctly copies the metatable.
C API:
- Add
YASLX_checknoptstrz, for checking forstr/undefand filling in a default value. - Deprecate
YASL_popcstr,YASL_peekuserdata, andYASL_popuserdata.
Internal Changes:
- Most
strs are now interned.
v0.13.4
New Features:
- Add
str.isupperandstr.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.writecrashing.
v0.13.3
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
-Dflag. str.split(int)now correctly returns alistof length 1 when no splits occur.str.split(int)now correctly handles whitespace after the last split.str.split(0)no longer returns an emptylist.
C API:
- Add
YASLX_print_value_err. - Add
YASLX_print_err_bad_arg_type_n, to cut down on boilerplate withYASLX_print_err_bad_arg_type. - Add
YASLX_throw_value_errandYASLX_throw_type_err, to cut down on boilerplate withYASL_throw_err. - Add
YASLX_checknoptint,YASLX_checknoptfloat,YASLX_checknoptboolfor checking if a value is the specific type orundef. - Add
YASL_checknstr.
v0.13.2
Bug Fixes:
- Fixed bug introduced in
v0.13.1that caused incorrect handling of commandline arguments. - Fixed crash when there is a syntax error while using the
-Dflag. - Added function declarations for a few missing functions in
yasl.h.
v0.13.1
New Features:
- Allow formatting of expressions in interpolated strings.
- Allow defining global variables from the command line with the
-Dflag.
Bug Fixes:
YASL_callfunctionnow works correctly with YASL functions (rather than only with C ones).returnin the body of amatchin a variadic function now works correctly.- Fixed bug with comparison operators causing a crash when used with
list,table, andsetliterals.
v0.13.0
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->searchnow looks from start of list (previously, looked from end due to bug)..no longer looks in the metatable.collections.tableno longer adds an extraundef, 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.getfortable,list, anduserdata. - Iteration now uses
ininstead of<-.
New Features:
- Add
int->tocharandstr->tobytefunctions, to allow turning numeric codes to strings and vice-versa (e.g.a->97and vice-versa). - Add
'r','d','x', and'b'formats forint->tostr. - Add
'r'format tostr->tostr. - Forward format args for
list->tostr,set->tostr, andtable->tostrto their elements. - Add
str->isprintfunction to check for printable characters.
C API:
- Add
YASLX_tablesetfunctionsto allow adding multiple functions at once to a table from C.
Bug Fixes:
YASLX_checknintandYASLX_checknfloatnow 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
strcontaining'\0'to a file (previously, we used the C functionstrlenfor this, resulting in incorrectly writing too short of a length).
Other Changes:
- Allow
pure,consteval,constexpr,constfoldandyieldas identifier names (previously, they were reserved).
v0.12.4
Bug Fixes:
- Fix Unicode output on Windows.
v0.12.3
New Features:
- Add
max_splitsargument tostr.split, to allow only splitting up to a certain number of times. - Add
mt.setselffunction. - Add
mt.lookupfunction.
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.