Basic interface for configuration evaluation #
Evaluates f e, and if that does throwUnsupportedExpr, evaluates f (← whnf e).
If either throw another exception, aborts immediately with that exception.
If both do throwUnsupportedExpr, then this generates an exception.
Instances For
Gets the current name of the option after any shifting.
For example, if an option is named a.b.c.d and there is a handler
for a.b.*, then the handler receives a ConfigItem whose current option
name is c.d.
Instances For
Drops the first component of the optionName, returning the new config item.
The first component is stored at the front of prevOptionComps.
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
Interprets cfg as configuration item or list of configuration items.
Items are interpreted in a way that allows user-defined configurations. Nearly anything that looks like configuration items or lists of configuration items will be interpreted. We're expecting an item that has one of the following formats:
"(" ident/atom ":=" syntax ")""+" ident/atom"-" ident/atom
The specification:
- A null node is a list of configurations
- A one-argument node is considered to be a wrapper like
optConfigorconfigItem. - A node with at two arguments starting with a "+"/"-" atom and whose second
argument is an ident or atom is a
posConfigItem/negConfigItem - A node with at most five arguments starting with a "(" atom and whose second argument
is an ident or atom is a
valConfigItem. The fourth argument is the value, and it is allowed to have arbitary syntax (it does not need to be aTerm). - A bare atom is considered to be a
"+"option.
We trust that any atoms are valid as idents. The atom will be parsed using String.toName
to form the name. (Small optimization: if the name doesn't contain ., we use Name.mkSimple
to skip parsing. Atoms must not contain numerals or «» escapes.)
On interpretation error, onErr is called with the current configuration object and the offending
syntax item. It may process the item itself or otherwise throw an error. We leave it to onErr
to decide what to do for items containing Syntax.missing.
Like foldConfigM but takes an array of configurations or configuration items.
Instances For
Default onErr handler. If the cfgItem contains .missing, we assume an error has already been
reported by the parser and return cfg. Otherwise, we throw an unsupported syntax exception.
If cfgType? is present, then it adds completion info when the identifier is missing.
Instances For
Applies the configuration cfg to init using eval.set.
If logExceptions is true, then catches and logs exceptions.
The onErr callback is used for invalid configuration syntax.
Note: this should be run from within runConfigElab.
Instances For
Applies the configuration cfg to init using eval.set.
If logExceptions is true, then catches and logs exceptions.
The onErr callback is used for invalid configuration syntax.
Note: this should be run from within runConfigElab.
Instances For
Runs mx using a fresh meta and term state.
This should be used around any configuration elaboration.
Instances For
Calls EvalConfigItem.setConfig' from within runConfigElab.
Instances For
Calls EvalConfigItem.setConfigs' from within runConfigElab.