Skip to content

Support dictionary scoping as lvalue

Currently can use ${:subdict.name} as rvalue substitution - using the : to denote an absolute location, but it is not possible to use this type of notation as a lvalue. For example :subdict.name as a name, since : is a punctuation token. It might be possible to add additional quoting etc, but could also make sense just to allow another character for denoting an absolute location. I would propose allowing ^ as an absolute position anchor. This is a one-line change in dictionary::lookupScopedEntryPtr()

if (keyword[0] == ':' || keyword[0] == '^')

Once this is in place, I could rework the removeEntry function entry to handle scoped names and eliminate the current restriction:

The removal only occurs in the current context. Removing sub-entries or parent entries is not supported.

@andy @Mattijs