Commit Graph

1329 Commits

Author SHA1 Message Date
Kartik Agaram ab87ccf62e couple of helpers for parsing expressions in parens 2019-08-22 00:25:41 -07:00
Kartik Agaram 0bb09d2e14 5522 - example app: random number stream
Turns out Mu's kernel isn't populating /dev/random correctly.
2019-08-20 00:20:38 -07:00
Kartik Agaram db1874cae2 . 2019-08-16 14:09:56 -07:00
Kartik Agaram 67dac668e3 sketch of a plan to implement indirect mode 2019-08-16 14:08:40 -07:00
Kartik Agaram c78f6b780b desugar: code-generate *reg 2019-08-16 00:34:27 -07:00
Kartik Agaram 343666bea3 plan for supporting indirect mode
It may superficially seem like there's a simpler approach:

- emit '3/mod' or '0/mod' depending on whether the character is '%' or '*'
- increment the start of word-slice
- look up the register and emit the appropriate /rm32

But that won't work for 1/mod or 2/mod. We're doing a little bit of
upfront planning.
2019-08-16 00:28:44 -07:00
Kartik Agaram 05b95e0aaf . 2019-08-16 00:12:31 -07:00
Kartik Agaram 37ea8c410e . 2019-08-16 00:10:55 -07:00
Kartik Agaram dbb380b87f add desugar to CI 2019-08-13 22:32:54 -07:00
Kartik Agaram 306812cc30 done implementing all variants of 'get' 2019-08-13 22:13:14 -07:00
Kartik Agaram 328a8e11f6 done with get-or-stop 2019-08-13 17:15:08 -07:00
Kartik Agaram 0059698b0b half-done testing get-or-stop
Probably not needed for desugar; I'm just working through what we may
replace the calls to 'get-slice' with if and when we decide to start
focusing error messages and so writing tests for them.
2019-08-13 12:40:25 -07:00
Kartik Agaram 63b8b18ef7 standardize test input/output/error streams 2019-08-13 12:27:15 -07:00
Kartik Agaram 64e8faba37 . 2019-08-13 12:19:49 -07:00
Kartik Agaram bfb2a8c0f0 get desugar working on the commandline 2019-08-13 10:57:05 -07:00
Kartik Agaram 64d51af46f . 2019-08-13 09:55:28 -07:00
Kartik Agaram d826a2d659 new variant: maybe-get-slice 2019-08-13 00:06:18 -07:00
Kartik Agaram 2b48729fd2 new variant: maybe-get returns null on failure 2019-08-12 23:39:53 -07:00
Kartik Agaram 15a84e2449 better error message when get aborts 2019-08-12 23:18:31 -07:00
Kartik Agaram 94d68ac244 extract table functions into their own layer 2019-08-11 23:30:20 -07:00
Kartik Agaram 37c859058d table-based register conversion
Requires a change to the C++ translator: support string literals in all
segments, not just the code segment.

(The self-hosted translator already had this.)
2019-08-01 14:50:19 -07:00
Kartik Agaram 70decc7aef .
First step to cleaning up `desugar-register`: extract the common '%' to
register literals.
2019-08-01 10:54:27 -07:00
Kartik Agaram d0016e126f desugar: code-generate %reg
We're no longer just emitting the register code. We emit all arguments
with appropriate metadata.
2019-07-31 19:18:28 -07:00
Kartik Agaram 34c86ff559 . 2019-07-31 17:37:09 -07:00
Kartik Agaram 129d812c2e Merge branch 'master' into desugar 2019-07-31 17:35:15 -07:00
Kartik Agaram 0b4e8494d6 desugar: clean up top-level `convert`
Model it on `dquotes` rather than `pack`, since it needs almost zero
state across words.

Manual testing:
  $ echo 'ab %eax' |subx run apps/desugar
  ab 0
2019-07-31 17:34:30 -07:00
Kartik Agaram 1ed1d1c842 5499 2019-07-31 15:28:23 -07:00
Kartik Agaram 070d5f2fc8 Merge branch 'master' into desugar 2019-07-28 13:40:29 -07:00
Kartik Agaram 6e1eeeebfb 5485 - promote SubX to top-level 2019-07-27 17:47:59 -07:00