0.3
Riff 0.3 adds support for common I/O operations, as well as various changes and bug fixes.
New Features
- Support for file handles as a data type.
- Library functions:
open()
close()
read()
write()
flush()
eof()
get()
getc()
putc()
print()
printf()
eval()
exit()
- Predefined variables for standard I/O streams:
stdin
stdout
stderr
- Support for program input via standard input.
%m
format specifier for formatting integers as a multi-character string.- Support for bracket-delimited table literals. E.g.
[1,2,3]
.
Changes
- Interpreting Riff programs stored in files is now the default operation on the command-line. Literal programs provided on the command-line can be executed using the
-e
option. - Logical expressions (
&&
,||
) no longer evaluate strictly to1
or0
. - Support for
exit
andprint
as keywords have been removed in favor of library functionsexit()
andprint()
, respectively. srand()
now returns the value used to seed the PRNG.
Fixes
%c
format specifier now formats Unicode code points aschar()
andputc()
do.- Fixed an issue where strings with embedded zeros would not be parsed properly when used in regex operations.
- Fixed an issue where valid expressions like
a=f(b=1)
ora=b[c=d]
would throw an error during compilation. - Syntax errors such as
a=b+c=3
are now caught during compilation (I swear I already did this). - Fixed a bug related to shebang handling.
- Fixed a buffer overflow issue when disassembling programs containing long string literals.
- Fixed an issue where table lookups would cause a segmentation fault when the key is an unsupported data type.
- Fixed a bug where
break
orcontinue
statements not inside some loop construct would not be caught at compile time if the lexical depth was >= 1. - Runtime regex compilation errors are now caught. This could otherwise cause segfaults when a string is the RHS of a match expression, and the string is an invalid regex.
Full Changelog: 0.2.2...0.3