From 1e1017cd9270c69e89f22d84361b7e8de7ab4b32 Mon Sep 17 00:00:00 2001 From: CrossNox Date: Tue, 29 Nov 2022 09:00:44 -0300 Subject: [PATCH] fix buscar-tipo-de-retorno --- src/rustint/core.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rustint/core.clj b/src/rustint/core.clj index eab9352..1186caf 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -2447,12 +2447,12 @@ ; user=> (buscar-tipo-de-retorno [(symbol ";") (list 'println! (symbol "(") "La suma de 5 mas 7 es {}" (symbol ",") 'suma (symbol "(") 5 (symbol ",") 7 (symbol ")") (symbol ")") (symbol ";") (symbol "}")) ['fn 'suma (symbol "(") 'x (symbol ":") 'i64 (symbol ",") 'y (symbol ":") 'i64 (symbol ")") (symbol "->") 'i64 (symbol "{") 'x '+ 'y (symbol "}") 'fn 'main (symbol "(") (symbol ")") (symbol "{") 'suma (symbol "(") 5 (symbol ",") 7 (symbol ")")] :sin-errores [[0 2] [['suma ['fn [(list ['x (symbol ":") 'i64] ['y (symbol ":") 'i64]) 'i64]] 2] ['main ['fn [() ()]] 8]]] 0 [['CAL 8] 'HLT ['POPARG 1] ['POPARG 0] ['PUSHFM 0] ['PUSHFM 1] 'ADD 'RET ['PUSHFI 5] ['PUSHFI 7] ['CAL 2]] [[2 ['i64 nil] ['i64 nil]] [8]]] 1) ; nil ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defn get_addr_map [sv] - (apply merge (cons nil (map #(hash-map (get %1 0) (get (get %1 1 ['()]) 0)) sv))) +(defn get_addr_map [addrs] + (apply merge (map #(hash-map (get %1 2) (get-in %1 [1 1 1]) ) addrs)) ) -(defn buscar-tipo-de-retorno [space addr] - (let [addrs (last space), +(defn buscar-tipo-de-retorno [amb addr] + (let [addrs (second (contexto amb)), addr_map (get_addr_map addrs) ] (get addr_map addr)