| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Now that we have a fake screen we can start testing it.
|
| |
|
| |
|
|
|
|
| |
So copypasta, much wow.
|
| |
|
| |
|
|
|
|
|
| |
We still need a few primitives, but we can implement these as needed. I'm
ready to call the fake screen done.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
No support for combining characters. Graphemes are currently just utf-8
encodings of a single Unicode code-point. No support for code-points that
require more than 32 bits in utf-8.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Finally this compiles.
|
|
|
|
| |
Also more error-detection for this case all across the toolchain.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
1000+ LoC spent; just 300+ excluding tests.
Still one known gap; we don't check the entirety of an array's element
type if it's a compound. So far we just check if say both sides start with
'addr'. Obviously that's not good enough.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's a question of how we should match array types with a capacity on
ones without. For now we're going to do the simplest possible thing and
just make type-match? more robust. It'll always return false if the types
don't match exactly. For ignoring capacity we'll rely on the checks of
the `address` operation (which don't exist yet). This means we should do
this to pass an address to an array to a function f with signature `f (addr
array int)`:
var a: (array int 3)
var b/eax: (addr array int) <- address a
f b
rather than this:
var a: (array int 3)
var b/eax: (addr array int 3) <- address a
f b
Similar reasoning applies to stream types. Arrays and streams are currently
the only types that can have an optional capacity.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example program:
fn main -> r/ebx: int {
var x/eax: code-point <- copy 0x2192 # unicode character 'rightwards arrow'
print-code-point 0, x
print-string 0, "\n"
r <- copy 0
}
Run:
$ ./translate_mu x.mu && ./a.elf
→
$
|
|
|
|
|
| |
I have it partly working, but just realized I've been reversing the output
bytes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example:
fn main -> r/ebx: int {
var x/eax: grapheme <- copy 0x9286e2 # code point 0x2192 in utf-8
print-grapheme-to-real-screen x
print-string-to-real-screen "\n"
}
Graphemes must fit in 4 bytes (21 bits for code points). Unclear what we
should do for longer clusters since graphemes are a fixed-size type at
the moment.
|
|
|
|
| |
Another stupid bug: I've been printing out 3 nulls for every byte of ascii.
|
|
|
|
|
| |
This is stupid; all this while I've been writing escape sequences to the
screen they've been going out on stderr.
|
|
|
|
|
|
|
|
|
|
| |
Both have the same size: 4 bytes.
So far I've just renamed print-byte to print-grapheme, but it still behaves
the same.
I'm going to support printing code-points next, but grapheme 'clusters'
spanning multiple code-points won't be supported for some time.
|
| |
|
| |
|
|
|
|
|
|
| |
One thing I hadn't realized in all my hacking on the mu1 prototype: clear-screen
doesn't modify active attributes. It's equivalent to printing spaces all
over the screen with the current attributes.
|
|
|
|
|
| |
We now have all existing apps and prototypes going through the dependency-injected
wrapper, even though it doesn't actually implement the fake screen yet.
|