This commit is contained in:
Kartik K. Agaram 2021-05-04 20:09:07 -07:00
parent 0069028dae
commit 5e0f459848
2 changed files with 25 additions and 3 deletions

View File

@ -1026,9 +1026,14 @@ fn cell-isomorphic? _a: (addr cell), _b: (addr cell), trace: (addr trace) -> _/e
trace-text trace, "eval", "=> true (numbers)"
return 1/true
}
compare b-type, 2/symbol
{
break-if-!=
$cell-isomorphic?:text-data: {
{
compare b-type, 2/symbol
break-if-=
compare b-type, 3/stream
break-if-=
break $cell-isomorphic?:text-data
}
var b-val-ah/eax: (addr handle stream byte) <- get b, text-data
var _b-val/eax: (addr stream byte) <- lookup *b-val-ah
var b-val/ecx: (addr stream byte) <- copy _b-val

View File

@ -1,3 +1,20 @@
fn macroexpand _in-ah: (addr handle cell), _out-ah: (addr handle cell), globals: (addr global-table), trace: (addr trace) {
var in-ah/esi: (addr handle cell) <- copy _in-ah
var out-ah/edi: (addr handle cell) <- copy _out-ah
# loop until convergence
{
macroexpand-iter in-ah, out-ah, globals, trace
var _in/eax: (addr cell) <- lookup *in-ah
var in/ecx: (addr cell) <- copy _in
var out/eax: (addr cell) <- lookup *out-ah
var done?/eax: boolean <- cell-isomorphic? in, out, trace
compare done?, 0/false
break-if-!=
copy-object out-ah, in-ah
loop
}
}
fn macroexpand-iter _in-ah: (addr handle cell), _out-ah: (addr handle cell), globals: (addr global-table), trace: (addr trace) {
copy-object _in-ah, _out-ah
}