Skip to content

0.3

Compare
Choose a tag to compare
@darrylabbate darrylabbate released this 30 Jan 23:44
· 137 commits to master since this release
0.3
5b82494

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 to 1 or 0.
  • Support for exit and print as keywords have been removed in favor of library functions exit() and print(), respectively.
  • srand() now returns the value used to seed the PRNG.

Fixes

  • %c format specifier now formats Unicode code points as char() and putc() 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) or a=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 or continue 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