Commit Graph

6742 Commits

Author SHA1 Message Date
Kartik Agaram 8ce50909c4 6592 - error-checking for integer stmts feels done 2020-06-28 23:25:18 -07:00
Kartik Agaram 9483fdc1fb 6591 2020-06-28 23:17:34 -07:00
Kartik Agaram 4ddc2620f7 6590 2020-06-28 23:10:45 -07:00
Kartik Agaram 896e3bcfb2 6589 2020-06-28 23:09:10 -07:00
Kartik Agaram d31bd529f7 6588 2020-06-28 18:49:50 -07:00
Kartik Agaram 52d3ee0326 6587 2020-06-28 14:35:45 -07:00
Kartik Agaram f7a174c2a1 6586 - error-checking for 'get' stmts feels done 2020-06-28 14:23:31 -07:00
Kartik Agaram 1a89b13b9c 6585 2020-06-28 11:50:50 -07:00
Kartik Agaram bf4fbab76d 6584 2020-06-28 10:19:02 -07:00
Kartik Agaram 60bffdaa49 6583 2020-06-28 09:53:32 -07:00
Kartik Agaram 76a669f689 6582 2020-06-28 09:10:16 -07:00
Kartik Agaram fbc4544ff8 6581 2020-06-28 08:49:08 -07:00
Kartik Agaram e98a6babb5 6580 2020-06-28 08:25:37 -07:00
Kartik Agaram f58a6acc3f 6579 2020-06-28 00:55:31 -07:00
Kartik Agaram 1da16dd6cb 6578 - redo error if 'get' on unknown field
This commit reimplements commit 6515 to happen during type-checking rather
than as early as possible. That way we naturally get a more informative
error message.
2020-06-27 21:03:43 -07:00
Kartik Agaram ab42709e14 6577 2020-06-27 14:30:07 -07:00
Kartik Agaram 14d9b56668 6576 2020-06-27 14:23:50 -07:00
Kartik Agaram ca9dec80b6 6575 2020-06-27 12:13:43 -07:00
Kartik Agaram a39d96444b 6574 2020-06-27 11:47:36 -07:00
Kartik Agaram 3a558d22ec 6573 2020-06-21 23:29:46 -07:00
Kartik Agaram 3b02c3dfa2 6572
Small change to mu.subx to keep the treeshaker working with it. That's
currently the only place where we prevent jumps across 'functions'.
2020-06-21 17:31:38 -07:00
Kartik Agaram 47fe226b7e 6571 2020-06-21 17:13:21 -07:00
Kartik Agaram 6bfb565819 6570 - error on use of a clobbered var
All tests now passing, and factorial.mu and all other apps now working.
The new checks caught one problem in a few prototypes.
2020-06-21 17:08:03 -07:00
Kartik Agaram 6883b8d1c7 6569 - correct the second failing test 2020-06-21 16:53:44 -07:00
Kartik Agaram c50303cc63 6568 2020-06-21 14:58:14 -07:00
Kartik Agaram b38d54c402 6567 2020-06-21 14:56:25 -07:00
Kartik Agaram 056858ddd9 6566 - improve some error messages
I need to pass the function around to fix the failing test; might as well
fix the error messages while I'm at it.
2020-06-21 14:46:08 -07:00
Kartik Agaram 85eb816725 6565 - support tmux in control mode
https://github.com/tmux/tmux/wiki/Control-Mode
https://www.iterm2.com/documentation-tmux-integration.html
2020-06-21 14:08:30 -07:00
Kartik Agaram 8d40bf6705 6564 - second failing test 2020-06-21 11:57:48 -07:00
Kartik Agaram 4efc921811 6563
The desire captured by a test is often hard to verbalize, path-dependent
and more fertile for the future than its original impulse. On some level,
someone wanting to rip out features has to just ask for each scenario,
"what do I want to happen here?" And nobody's gonna do that. At best, somebody
may be trying to rip out some complex feature, and run into some collateral
damage around the edges that they have to inspect more closely. "Do I care
about preserving this behavior?"
2020-06-21 11:54:11 -07:00
Kartik Agaram c70beadc7a 6562
The new failing test is now passing, and so is this manual test that had
been throwing a spurious error:
  fn foo {
    var a/eax: int <- copy 0
    var b/ebx: int <- copy 0
    {
      var a1/eax: int <- copy 0
      var b1/ebx: int <- copy a1
    }
    b <- copy a
  }

However, factorial.mu is still throwing a spurious error.

Some history on this commit's fix: When I moved stack-location tracking
out of the parsing phase (commit 6116, Mar 10) I thoughtlessly moved block-depth
tracking as well. And the reason that happened: I'd somehow gotten by without
ever cleaning up vars from a block during parsing. For all my tests, this
is a troubling sign that I'm not testing enough.

The good news: clean-up-blocks works perfectly during parsing.
2020-06-21 11:06:25 -07:00
Kartik Agaram 19fea2b6a2 6561 - failing test
Test `test-shadow-name-2` shows that we aren't popping off more than one
variable from each block that we exit.
2020-06-21 10:33:23 -07:00
Kartik Agaram c94b8c3797 6560 2020-06-20 15:50:57 -07:00
Kartik Agaram 4f16cfa166 6559 2020-06-20 15:45:34 -07:00
Kartik Agaram 7bcab1c417 6558 - dump the stack of local vars
I'm still tracking down at least one bug in how that stack is managed.
2020-06-20 15:44:47 -07:00
Kartik Agaram 6131749762 6557 - fix a bug in pack.subx
I was shifting bitfields around based on their width rather than the width
of the field to their right.

Kinda shocking that I haven't used the scale bits until now. I've been
generating code that uses them in mu.subx tests, but apparently I haven't
actually _run_ any such code before.
2020-06-20 00:50:36 -07:00
Kartik Agaram d1ad96e038 6556 - check for uses of clobbered vars
Now all tests passing again. In the process I found a bug where one of
my tests actually generated incorrect code.
2020-06-19 23:25:43 -07:00
Kartik Agaram 3a8ce1e87f 6555 - fix one class of failing tests
Defining a new var in a register based on a previous var in the same register.

Unfortunately I don't yet support such an instruction without getting into
arrays. Ideally I want `y <- add x, 1` to convert to the same code as `x
<- add x, 1` if `y` ends up in the same register. And so on. But I don't
yet have a way to specify "output same register as inout 1" in my `Primitives`
data structure.
2020-06-19 22:02:57 -07:00
Kartik Agaram 9d5554fbed 6554 - snapshot: error on use of a clobbered var
When looking up a var, ensure that it's the var most recently written to
its register.

The new test passes, but a handful of tests now start failing when a new
var in register X is initialized based on the old var in register X. The
way we do lookups is not quite right. At the moment we perform lookups
when we parse words. So we look up outputs of a statement before inputs.
But old bindings are still valid for the entirety of a statement, and outputs
should only take effect for the next statement.
2020-06-19 21:01:07 -07:00
Kartik Agaram 4d2f171ce1 6553 - Mu: disallow registers esp and ebp 2020-06-19 20:52:37 -07:00
Kartik Agaram 63a4fd039c 6552 2020-06-18 09:04:09 -07:00
Kartik Agaram 04da2a7d10 6551 2020-06-18 08:59:30 -07:00
Kartik Agaram 88908608b0 6550 - type-checking for function calls
There were a couple of benign type errors in arith.mu but nowhere else.
2020-06-18 08:57:48 -07:00
Kartik Agaram 9ab613b233 6549 - starting on type checking 2020-06-17 13:59:22 -07:00
Kartik Agaram b36f2793f7 6548 2020-06-16 00:15:05 -07:00
Kartik Agaram 8f9b21f085 6547 2020-06-16 00:09:16 -07:00
Kartik Agaram 427ea89235 6546 2020-06-15 23:54:59 -07:00
Kartik Agaram f1dffb4130 6545 2020-06-15 23:54:11 -07:00
Kartik Agaram 4e48a43660 6544 - arith: doc 2020-06-15 23:53:07 -07:00
Kartik Agaram 2fcdca0649 6543 - arith: cleanup 2020-06-15 23:39:05 -07:00