Class: KipperSemanticErrorHandler
compiler.KipperSemanticErrorHandler
Error handler which handles semantic errors for compilable AST nodes.
Since
0.8.0
Hierarchy
KipperSemanticErrorHandler
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new KipperSemanticErrorHandler()
Properties
col
• Protected col: undefined | number
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:16
ctx
• Protected ctx: undefined | CompilableASTNode<SemanticData, TypeData>
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:17
filePath
• Protected filePath: undefined | string
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:18
line
• Protected line: undefined | number
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:15
stream
• Protected stream: undefined | KipperFileStream
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:19
Methods
error
▸ Protected error(error): KipperError
Updates the error and adds the proper traceback data, and returns it.
This function also automatically logs the error.
Parameters
| Name | Type | Description |
|---|---|---|
error |
KipperError |
The error to update. |
Returns
The Kipper error.
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:52
setTracebackData
▸ setTracebackData(data): void
Sets the traceback related metadata that will be used to create a traceback for an KipperError instance.
In case that data.ctx is set and other fields are missing, these fields will be filled up using the data in the data.ctx AST node ctx instance.
Since
0.8.0
Parameters
| Name | Type | Description |
|---|---|---|
data |
Object |
The traceback data that will be used to initialise an KipperError instance. |
data.col? |
number |
- |
data.ctx? |
CompilableASTNode<SemanticData, TypeData> |
- |
data.filePath? |
string |
- |
data.line? |
number |
- |
data.stream? |
KipperFileStream |
- |
Returns
void
Defined in
kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts:29