Skip to content

Version 0.21.0

Latest
Compare
Choose a tag to compare
@ballercat ballercat released this 02 Jan 01:04
· 4 commits to master since this release

Version 0.21.0 of walt-compiler

Features

  • Type aliases. Any type can be aliased N-times. Eg. type Integer = i32;
  • Basic union types, only indexed (arrays) of native types are allowed to be combined with structs. Done via | operator in type declarations. Eg. type Indexed = SomeStruct | i32[];.
  • Arrays of structs properly supported. Indexing into struct arrays now returns offset to the desired memory address instead of a load operation at the address.
  • Direct addressing/offset in structs now supported. This allows indexing directly into memory mapped by a struct, instead of indirectly by loading the address stored in the struct property. Done by prefixing a key with a & operator. Eg. type String = { byteLength: i32, &data: i32[] };
  • Created dedicated specs to syntax features - work in progress.
  • Internal tests can now debug themselves via magic INTROSPECT_* exports, which can print debug version of the syntax without editing test harness logic.

Bugfixes

  • Multiple fixes of property access on struct types.
  • Multiple fixes to grammar (mostly struct/array related).
  • Struct validation fixes.
  • Fix structs as return values of functions.