Don't let defs shadow builtins.

This commit is contained in:
Simon Forman 2023-02-14 08:39:52 -08:00
parent f0c94aeed8
commit ad0f135376
1 changed files with 3 additions and 1 deletions

View File

@ -573,7 +573,9 @@ proc add_def(def: string, dictionary: var JoyMapType) =
let sym = d.head
case sym.kind:
of joySymbol:
dictionary = dictionary + (sym.symVal, d.tail)
let def = dictionary.get(sym.symVal)
if def.isEmpty:
dictionary = dictionary + (sym.symVal, d.tail)
else:
raise newException(ValueError, def)