Don't let defs shadow builtins.
This commit is contained in:
@@ -573,6 +573,8 @@ proc add_def(def: string, dictionary: var JoyMapType) =
|
|||||||
let sym = d.head
|
let sym = d.head
|
||||||
case sym.kind:
|
case sym.kind:
|
||||||
of joySymbol:
|
of joySymbol:
|
||||||
|
let def = dictionary.get(sym.symVal)
|
||||||
|
if def.isEmpty:
|
||||||
dictionary = dictionary + (sym.symVal, d.tail)
|
dictionary = dictionary + (sym.symVal, d.tail)
|
||||||
else:
|
else:
|
||||||
raise newException(ValueError, def)
|
raise newException(ValueError, def)
|
||||||
|
|||||||
Reference in New Issue
Block a user