1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-31 19:15:20 +00:00

Make reloads go through the Abacus core.

This commit is contained in:
2017-09-06 22:03:54 -07:00
parent 91986112a1
commit 924849bd8b
6 changed files with 13 additions and 25 deletions

View File

@@ -46,10 +46,6 @@ class Abacus(val configuration: Configuration) {
* The promotion manager used to convert between number implementations.
*/
val promotionManager = PromotionManager(this)
/**
* The database of variable definitions.
*/
val variableDatabase = VariableDatabase(this)
/**
* The hidden, mutable implementation of the context.
@@ -65,9 +61,16 @@ class Abacus(val configuration: Configuration) {
pluginManager.addListener(tokenizer)
pluginManager.addListener(parser)
pluginManager.addListener(promotionManager)
pluginManager.addListener(variableDatabase)
}
fun reload(){
pluginManager.reload()
with(mutableContext) {
numberImplementation = pluginManager.numberImplementationFor(configuration.numberImplementation)
clearVariables()
clearDefinitions()
}
}
/**
* Parses a string into a tree structure using the main
* tree builder.