Class: EvaluatedCompileConfig
compiler.EvaluatedCompileConfig
Runtime Compile config class, which implements the CompileConfig interface and is able to be passed onto the compile function as a valid config argument.
This class will store both the default values and actual values for the compilation. All actual values will be processed and evaluated on construction, so that every option is not undefined.
Since
0.1.0
Implements
Table of contents
Constructors
Properties
- abortOnFirstError
- builtInFunctions
- builtInVariables
- extendBuiltInFunctions
- extendBuiltInVariables
- fileName
- optimisationOptions
- recover
- target
- userOptions
- warnings
- defaults
Methods
Constructors
constructor
• new EvaluatedCompileConfig(rawConfig
)
Parameters
Name | Type |
---|---|
rawConfig |
CompileConfig |
Defined in
kipper/core/src/compiler/compile-config.ts:224
Properties
abortOnFirstError
• Readonly
abortOnFirstError: boolean
Throws an error and cancels the compilation on the first error that is encountered.
This per default overwrites recover.
Since
0.10.0
Implementation of
CompileConfig.abortOnFirstError
Defined in
kipper/core/src/compiler/compile-config.ts:207
builtInFunctions
• Readonly
builtInFunctions: BuiltInFunction
[]
The built-in functions that will be available in a Kipper program.
This will be extended by extendBuiltInFunctions. All built-in functions defined here must be implemented by the target.builtInGenerator.
Implementation of
CompileConfig.builtInFunctions
Defined in
kipper/core/src/compiler/compile-config.ts:144
builtInVariables
• Readonly
builtInVariables: BuiltInVariable
[]
The built-in variables that will be available in a Kipper program. This option overwrites the default built-ins, if you wish to only add new built-in variables write to extendBuiltInVariables.
All built-in variables defined here must be implemented by the target.builtInGenerator.
Since
0.10.0
Implementation of
CompileConfig.builtInVariables
Defined in
kipper/core/src/compiler/compile-config.ts:153
extendBuiltInFunctions
• Readonly
extendBuiltInFunctions: BuiltInFunction
[]
Extensions to the global built-in functions that should not replace the primary builtInFunctions.
All built-in functions defined here must be implemented by the target.builtInGenerator.
Implementation of
CompileConfig.extendBuiltInFunctions
Defined in
kipper/core/src/compiler/compile-config.ts:160
extendBuiltInVariables
• Readonly
extendBuiltInVariables: BuiltInVariable
[]
Extends the builtInVariables with the specified items. If builtInVariables is undefined, then it will simply extend the default array.
All built-in variables defined here must be implemented by the target.builtInGenerator.
Since
0.10.0
Implementation of
CompileConfig.extendBuiltInVariables
Defined in
kipper/core/src/compiler/compile-config.ts:169
fileName
• Readonly
fileName: string
The filename that should be used to represent the program.
Since
0.2.0
Implementation of
Defined in
kipper/core/src/compiler/compile-config.ts:175
optimisationOptions
• Readonly
optimisationOptions: OptimisationOptions
Options for the KipperOptimiser.
Since
0.8.0
Implementation of
CompileConfig.optimisationOptions
Defined in
kipper/core/src/compiler/compile-config.ts:181
recover
• Readonly
recover: boolean
If set to true, the compiler will attempt to recover from compilation errors if they are encountered. This will lead to more errors being reported and allowing for bigger more detailed compiler logs, but can in rare cases lead to misleading errors that are caused as a result of another compilation errors.
Generally though, it is considered a good practise to use compiler error recovery, which is why it is enabled per default.
Since
0.10.0
Implementation of
Defined in
kipper/core/src/compiler/compile-config.ts:199
target
• Readonly
target: KipperCompileTarget
The translation languages for the compilation.
Since
0.5.0
Implementation of
Defined in
kipper/core/src/compiler/compile-config.ts:136
userOptions
• Readonly
userOptions: CompileConfig
Original user-defined CompileConfig, which may not be overwritten anymore, as the compile-arguments were already processed using the constructor of this class.
Defined in
kipper/core/src/compiler/compile-config.ts:114
warnings
• Readonly
warnings: boolean
If set to true, the compiler will check for warnings and add them to warnings and warnings.
Since
0.9.0
Implementation of
Defined in
kipper/core/src/compiler/compile-config.ts:188
defaults
▪ Static
Readonly
defaults: Object
The default configuration for this class.
Since
0.2.0
Type declaration
Name | Type |
---|---|
abortOnFirstError |
false |
builtInFunctions |
BuiltInFunction [] |
builtInVariables |
BuiltInVariable [] |
extendBuiltInFunctions |
BuiltInFunction [] |
extendBuiltInVariables |
BuiltInVariable [] |
fileName |
string |
optimisationOptions |
OptimisationOptions |
recover |
true |
warnings |
true |
Defined in
kipper/core/src/compiler/compile-config.ts:120
Methods
getConfigOption
▸ Private
getConfigOption<T
>(option
, rawConfig
): T
Gets a non-undefined config option from the specified config object. If the option is undefined, then the default value will be returned.
Since
0.10.0
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
option |
"warnings" | "builtInFunctions" | "extendBuiltInFunctions" | "builtInVariables" | "extendBuiltInVariables" | "fileName" | "optimisationOptions" | "recover" | "abortOnFirstError" |
The option key to get the option for. |
rawConfig |
CompileConfig |
The raw config object to get the option from. |
Returns
T
Defined in
kipper/core/src/compiler/compile-config.ts:217