Skip to main content

ErrorCollector

export interface ErrorCollector {
  errors: CompilerError[]
  syntax(
    site: Site,
    msg: string
  ): void
  throw(): void
}
An ErrorCollector accumulates CompilerErrors so that at the end of the compilation process all errors are logged at once, and all errors can be displayed in the IDE.

Use makeErrorCollector to create a new ErrorCollector.

Properties

errors

errors: CompilerError[]
The list of compiler errors collected

syntax

syntax(
  site: Site,
  msg: string
): void
Adds a syntax error

throw

throw(): void
Throws an error if it contains some errors