All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.compiler.InMemoryMessageCollector.kt Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
package io.fluidsonic.compiler

import org.jetbrains.kotlin.cli.common.messages.*


internal class InMemoryMessageCollector : MessageCollector {

	private var hasErrors = false
	private val _messages = mutableListOf()


	override fun clear() {
		_messages.clear()
	}


	override fun hasErrors() =
		hasErrors


	val messages
		get() = _messages.toList()


	override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageSourceLocation?) {
		if (severity.isError)
			hasErrors = true

		_messages += CompilationMessage(location = location, message = message, severity = severity)
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy