From a71ff2383a2f354a718aa58b7708fc1d45b96f04 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 28 Apr 2021 09:45:39 -0700 Subject: . --- shell/cell.mu | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'shell/cell.mu') diff --git a/shell/cell.mu b/shell/cell.mu index 8b9307c7..5533efc2 100644 --- a/shell/cell.mu +++ b/shell/cell.mu @@ -40,6 +40,20 @@ fn new-symbol out: (addr handle cell), val: (addr array byte) { initialize-symbol out, val } +fn symbol-equal? _in: (addr cell), name: (addr array byte) -> _/eax: boolean { + var in/esi: (addr cell) <- copy _in + var in-type/eax: (addr int) <- get in, type + compare *in-type, 2/symbol + { + break-if-= + return 0/false + } + var in-data-ah/eax: (addr handle stream byte) <- get in, text-data + var in-data/eax: (addr stream byte) <- lookup *in-data-ah + var result/eax: boolean <- stream-data-equal? in-data, name + return result +} + fn allocate-stream _out: (addr handle cell) { var out/eax: (addr handle cell) <- copy _out allocate out -- cgit 1.4.1-2-gfad0