| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've gone back and forth on this. I initially disallowed this, then allowed
it because I forgot why I disallowed it. The reason to disallow it: if
you return an `addr` to a variable allocated on the stack, the space might
be reused for a different type, which violates type-safety. And once you
can reinterpret bits of one type as another you lose memory-safety as well.
This has some interesting implications for Mu programs; certain kinds of
helper functions become impossible to write. Now I find myself relying a
lot more on scopes (and editor folding support) for abstracting details.
And they won't help manage duplication. We'll see how this goes.
While I'm being draconian about `addr`s on the stack, I'm still abusing
`addr`s on the heap, with the expectation that future checks on reclamation
will protect me. The boon and bane of stack space is that it's constantly
reclaimed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
Perhaps the lack of safety just forces us to make smaller functions, like
Forth.
|
|
Baby steps. I managed to mess up even this tiny refactoring of print-file.mu.
Wish output registers were already checked in calls.
|