-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Context.termDefinitions is a json object which we are sort-of abusing: for one, it is a public member in Context, mainly so that ContextProcessor can query and add to it. Public class members should be discouraged. Second, the "definitions" we are storing there are actually just other json objects that are created in ContextProcessor.createTermDefinition, and those json objects have extra stuff put into them like the IS_XXX flags (see step 10 of ContextProcessor.createTermDefinition). There is probably a better way of using an actual TermDefinition class to store that data, rather than abusing a json object.
So, perhaps we need a new TermDefinition class, maybe holding a json object to store the term def. data, plus a few bool flags and accessor functions for those (for example, replacing the IS_PREFIX_FLAG, IS_PROTECTED_FLAG and IS_REVERSE_PROPERTY_FLAG, ... maybe more?)
Then, we should also add a set to Context, plus accessor functions to add the new defintions to the context (step 28).