master
CrossNox 3 years ago
parent 2df65593d1
commit c6031e3afd
  1. 11
      src/rustint/core.clj

@ -2071,9 +2071,16 @@
; user=> (ya-declarado-localmente? 'Write [[0 2] [['io ['lib '()] 0] ['Write ['lib '()] 0] ['entero_a_hexa ['fn [(list ['n (symbol ":") 'i64]) 'String]] 2]]])
; false
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;TODO
(defn in?
"true if coll contains elm"
[coll elm]
(some #(= elm %) coll))
(defn ya-declarado-localmente? [ident ctx]
true
(let [inicio_scope_local (last (get ctx 0)),
scope_local (subvec (get ctx 1) inicio_scope_local),
identificadores_scope_local (map first scope_local)
] (in? identificadores_scope_local ident))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Loading…
Cancel
Save