mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-21 17:31:31 +00:00
Clean up source
This commit is contained in:
parent
ab2239753c
commit
6a67577a9b
@ -134,10 +134,8 @@ export def new_cons#1
|
||||
if cons_free
|
||||
consptr = cons_free
|
||||
cons_free = cons_free=>link
|
||||
//puts("Recycle cons\n")
|
||||
else
|
||||
consptr = heapalloc(t_cons)
|
||||
//puts("Alloc cons\n")
|
||||
fin
|
||||
consptr=>link = cons_list
|
||||
cons_list = consptr
|
||||
@ -153,8 +151,6 @@ def match_int(intlo, inthi)
|
||||
intptr = int_list
|
||||
while intptr
|
||||
if intptr=>intval[0] == intlo and intptr=>intval[1] == inthi
|
||||
//puts("Match int: ")
|
||||
//puti(int); putln
|
||||
return intptr
|
||||
fin
|
||||
intptr = intptr=>link
|
||||
@ -170,17 +166,14 @@ export def new_int(intlo, inthi)#1
|
||||
if int_free
|
||||
intptr = int_free
|
||||
int_free = int_free=>link
|
||||
//puts("Recycle int\n")
|
||||
else
|
||||
intptr = heapalloc(t_numint)
|
||||
//puts("Alloc int\n")
|
||||
fin
|
||||
intptr=>link = int_list
|
||||
int_list = intptr
|
||||
intptr->type = NUM_INT
|
||||
intptr=>intval[0] = intlo
|
||||
intptr=>intval[1] = inthi
|
||||
//puts("New int: "); puti(int); putln
|
||||
return intptr
|
||||
end
|
||||
|
||||
@ -198,8 +191,6 @@ def match_sym(symstr)
|
||||
if symptr->name[i] <> symstr->[i]; break; fin
|
||||
next
|
||||
if i > len
|
||||
//puts("Match symbol: ")
|
||||
//puts(symstr - 1); putln
|
||||
return symptr
|
||||
fin
|
||||
fin
|
||||
@ -220,7 +211,6 @@ export def new_sym(symstr)#1
|
||||
symptr=>natv = NULL
|
||||
symptr=>lambda = NULL
|
||||
memcpy(symptr + name, symstr + 1, ^symstr)
|
||||
//puts("New symbol: "); puts(symstr); putln
|
||||
return symptr
|
||||
end
|
||||
|
||||
@ -389,8 +379,7 @@ export def parse_expr(evalptr, level, refill)#2 // return evalptr, exprptr
|
||||
when ^evalptr
|
||||
is 0
|
||||
if level
|
||||
// Refill input buffer
|
||||
evalptr = refill()
|
||||
evalptr = refill() // Refill input buffer
|
||||
else
|
||||
return evalptr, exprptr
|
||||
fin
|
||||
@ -767,9 +756,10 @@ def natv_lt(expr)
|
||||
end
|
||||
|
||||
def natv_print(expr)
|
||||
print_expr(eval_expr(expr=>car))
|
||||
expr = eval_expr(expr=>car)
|
||||
print_expr(expr)
|
||||
putln
|
||||
return NULL
|
||||
return expr
|
||||
end
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user