| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
| |
Still some issues; add some tests. I have more that were passing a couple
of days ago but aren't currently.
|
|
|
|
|
|
|
|
|
|
|
| |
Before: bytes can't live on the stack, so size(byte) == 1 just for array
elements.
After: bytes mostly can't live on the stack except for function args (which
seem too useful to disallow), so size(byte) == 4 except there's now a new
primitive called element-size for array elements where size(byte) == 1.
Now apps/browse.subx starts working again.
|
| |
|
|
|
|
|
|
| |
Several bugs fixed in the process, and expectation of further bugs is growing.
I'd somehow started assuming I don't need to have separate cases for rm32
as a register vs mem. That's not right. We might need more reg-reg Primitives.
|
|
|
|
| |
More fucking amateur hour.
|
|
|
|
|
|
|
|
| |
Most unbelievably, I'd forgotten to pass the output 'out' arg to 'lookup-var'
long before the recent additions of 'err' and 'ed' args. But things continued
to work because an earlier call just happened to leave the arg at just
the right place on the stack. So we only caught all these places when we
had to provide error messages.
|
|
|
|
|
|
| |
Byte-oriented addressing is only supported in a couple of instructions
in SubX. As a result, variables of type 'byte' can't live on the stack,
or in registers 'esi' and 'edi'.
|
|
|
|
| |
We can't yet say in the error message precisely where the 'get' occurs.
|
|
|
|
|
| |
We now raise an error if a variable is declared on the stack with an initializer.
And there are unit tests for this functionality.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Fix a stray copy-paste when deciding whether to emit spills for registers
(commit 6464).
|
|
|
|
|
|
|
| |
I had a little "optimization" to avoid creating nested blocks if "they weren't
needed". Except, of course, they were. Lose the optimization. Sometimes
we create multiple jumps when a single one would suffice. Ignore that for
now.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The rule: emit spills for a register unless the output is written somewhere
in the current block after the current instruction. Including in nested
blocks.
Let's see if this is right.
|
|
|
|
|
|
| |
Rather than have two ways to decide whether to emit push/pop instructions,
just record for each var on the 'vars' stack whether we emitted a push
for it, and reuse the decision to emit a pop.
|
|
|
|
| |
Stack bug.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This 'OO' approach seems more scalable, but I need to first wrestle with
a parsing issue: this text has a heading:
abc *def
# ghi*
Ugh, so I can't do this translation in a single pass.
Then again, maybe I should just keep going and not try to be compatible
with GitHub-Flavored Markdown. Require that new headings are also new paragraphs.
|
|
|
|
|
| |
The state machine is already out of control, and I already have bugs like
turning '*abc_' into bold text.
|
| |
|
|
|
|
| |
Support more than two states.
|
|
|
|
| |
Now the trailing asterisk or underscore renders correctly, for starters.
|
|
|
|
|
| |
The current organization doesn't really work for the next feature (section
headings) so let's inline attribute-handling.
|
|
|
|
|
|
|
| |
We're not going to render italics since they still feel like an advanced
feature for terminals, and different terminals have different escape sequences
for them, and since they often look weird to my eyes on the monospace font
of a terminal window. So underscores and italics will both be bold.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Just always flush Stdout when printing numbers.
|
|
|
|
|
| |
Minor reordering; the hacky flush-stdout is now only needed if we ever
call print-int32-to-screen.
|
|
|
|
|
| |
Make print-byte less error-prone to use. Now none of our screen primitives
are buffered.
|
|
|
|
| |
At the moment the number of pages is hard-coded to my screen width.
|
|
|
|
|
|
|
|
| |
This was why I was trying to use a different output register: a second
function to call.
And I managed to mess it up again, changing the output of load-file, but
not how it was computed in the body.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were three confounding issues to get past before this seemed to be
working right:
- row/col count from 1 rather than 0
- I was thinking in decimal rather than hex
- print-byte buffers to stdout, but print-string does not. I didn't think
this mattered, but it does matter to flush the current line before
moving cursor again.
Only one of these issues was a bug in the code. The first two were bugs
in my mental model that necessitated no changes to code to be corrected.
|