orbit-lang/Bootstrap

Infrastructure - Extract & Review Error Messages & Warnings

Offen

#3 geöffnet am 16.05.2021

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Kotlin (0 Forks)auto 404
Infrastructuregood first issue

Repository-Metriken

Stars
 (0 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

The compiler currently propagates nice error messages & warnings via the Invocation class. However, these errors are hardcoded strings inside the various phases & components that make up the compiler. It would be very nice if:

  • Error strings were extracted and moved to a separate (preferrably localised) package or similar; AND
  • There was a simpler, unified api for raising compiler errors & warnings

I would like to be able to do something like:

private val errorUtil: ErrorUtil by inject()
...
throw errorUtil.error<Lexer>(Errors.Lexer.NoMoreTokens, context, ...any other parameters needed for this specific error)
...

Contributor Guide