orbit-lang/Bootstrap

Infrastructure - Extract & Review Error Messages & Warnings

开放

#3 创建于 2021年5月16日

 (0 条评论) (0 个反应) (0 位负责人)Kotlin (0 个派生)auto 404
Infrastructuregood first issue

仓库指标

星标
 (0 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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)
...

贡献者指南