remove accidental test file
codeowners: init
QBE generator (#42)

* Only build standard library for JS target

* Add initial data structures for QBE generator

* Allow generators to return an error

Required for QBE generator

* qbe: implement function generation

* qbe: generate integer literal expression

* qbe: generate return with expression

* qbe: generate boolean expression

* qbe: implement most of binary operations

* qbe: store a type in scope maps

* qbe: implement variable access expression

* qbe: implement function declarations

* qbe: implement if/else

* qbe: implement while loops

* qbe: implement break in loops

* qbe: implement continue

* qbe: implement expression statement

* qbe: implement function calls

* qbe: implement assignment for variables

* qbe: add QbeValue, use it instead of temporaries

With old approach, it was not possible for function call instruction to
accept a $-global value (for static strings), as well as having an
inconsistent API for QbeInstr::Copy because of Either<...>.

QbeValue can hold either a temporary, global or a constant literal. This
allows it to be used everywhere, without hacks like Either for copy.

* qbe: implement string literals

* qbe: move Assign into generate_assignment

* qbe: add typedefs

* qbe: generate offset table for structs

* qbe: implement struct initialization

* qbe: resolve struct variable types

* qbe: convert assignment QBE statements to base types

This prevents generating incorrect IR with structs

* qbe: implement field access

* qbe: do not cast to ABI types in scope

* qbe: implement assignments to field access

* qbe: store loop labels as a stack

Fixes issues when using continue/break in nested loops.

* docs: add QBE to supported backends

* Add QBE backend to changelog

* qbe: implement assignment BinOps (e.g. +=)

* qbe: resolve arrays in variable types

* qbe: implement array initialization

* qbe: add aggregate type fills (e.g. { w 12 })

* qbe: generate aggregate types for arrays
765a411d — Garrit Franke 2 years ago
readme: change matrix link text
Strings rework (#51)

* lexer: allow lex to return an error

* lexer: emit raw strings

* generator: wrap raw strings in C syntax

* docs/spec: add string escape sequences
spec: add string literals
spec: add integer literals
spec: add operators and punctuation
4930da31 — Garrit Franke 2 years ago
UTF-8 (#47)

* lex: check for unicode whitespace

* lex: add unicode support

* changelog: add unicode entry
qbe: remove vendored module
spec: format to fit 80 lines
spec: add identifiers and keywords
4e84dc89 — Garrit Franke 3 years ago
-o flag stdout (#44)

* build: add -o - flag option

* build: add -o help text

* changelog: add -o flag feature

* docs: add debugging document

* Remove - file
Improve parser errors (#45)

* Print error Strings from main verbatim

When returning Result<(), String> from main(), the error message is
escaped. This results in errors like this:

    $ sb build ...
    Error: "Re-declaration of variable \'v\'"

This probably happens because the error from main() is passed to the
debug formatter, but in this case it's better to use the default one.

The solution is to wrap the real main into a function like run(), and
then printing to stderr followed by exit(1) on an error from it.

* util: rewrite source file highlight

Old variant was a bit unintuitive on showing where the error occured.
The new implementation is inspired by what Rust and Zig are doing.

* parser: improve error messages

* Use standard format "<line>:<column>: <message>" everywhere. And if
  possible, include source file snippet.
* Deduplicate some messages

* Add improved parser errors to changelog
Use assert!(...) instead of assert_eq!(..., true)
fix: formatting
fix: clippy warnings
fix(ci): action version
fix(ci): deploy action
feat(x86): add x86 target