diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-07-23 11:06:55 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-07-23 11:06:55 -0700 |
| commit | 56df584eed3a7228ca06a9ed1e49272410a7e671 (patch) | |
| tree | e5b495821c1206eedfd0f6a7f33d37eda2cf8dcc /csc/linker.csc | |
| parent | Handle global variables. (diff) | |
| download | chromatopelma-56df584eed3a7228ca06a9ed1e49272410a7e671.tar.zst | |
Add a delete method to the red-black tree.
God damn delete is even more complicated than insert. I think it works,
at least.
Diffstat (limited to 'csc/linker.csc')
| -rw-r--r-- | csc/linker.csc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/csc/linker.csc b/csc/linker.csc index 852ee13..3327909 100644 --- a/csc/linker.csc +++ b/csc/linker.csc @@ -41,8 +41,15 @@ (hash-bytevector (string->utf8 s))) + (define (cmp-strings s1 s2) + (cond + ((string=? s1 s2) 0) + ((string<? s1 s2) -1) + (else 1))) + + (define (make-label-map program) - (let loop ((m (make-map hash-string string<?)) + (let loop ((m (make-map hash-string cmp-strings)) (program program) (i 0)) (match program |
