python-fluent icon indicating copy to clipboard operation
python-fluent copied to clipboard

Problem with E00001 in get_error_message in error.py under fluent.syntax package

Open createduser opened this issue 1 year ago • 1 comments

This is a very small problem. When I was looking at the source files in the fluent.syntax package, I found that in the get_error_message function in errors.py, the other error codes were all in the same format as E0003 with only four digits. Only E00001 was five digits. Since I am trying to develop a Fluent parser for the JVM in Kotlin, I need to know if this is intentional. This paragraph is originally in Chinese. I used Google Translate, so there may be some inaccuracies. The original Chinese text is below.

这是一个很小的问题。我在查看fluent.syntax包下源文件时发现errors.py中的get_error_message函数中,其它错误代码都是类似于E0003只有四位数字这样格式的错误代码。唯独只有E00001是五位数字。由于我在试着用Kotlin开发适用于JVM的Fluent解析器,我需要了解这是不是有意而为之。这段话原话是中文,我使用了谷歌翻译,有可能有不正确的地方。

  • https://github.com/projectfluent/python-fluent/blob/bc5b0e52a059944503ff2624b8d0f9c285d81016/fluent.syntax/fluent/syntax/errors.py#L12-L15

createduser avatar Jul 23 '24 12:07 createduser

That looks like a typo originally made here for fluent.js, and then ported to this implementation.

Given that there is no code path that that produces a Generic Error, a PR fixing the code for it would be welcome both here and in projectfluent/fluent.js.

eemeli avatar Jul 25 '24 18:07 eemeli