google / emboss

Emboss is a tool for generating code that reads and writes binary data structures.
Apache License 2.0
68 stars 21 forks source link

Emit compilation errors for bad C++ namespaces #92

Closed jasongraffius closed 1 year ago

jasongraffius commented 1 year ago

Prior to this PR, an incorrectly-formatted namespace will fail an assert and print a python exception to the user. While this likely sufficient for a user to diagnose the issue, it is inconsistent with other error reporting in Emboss.

With this change, the namespace checking is implemented in the same way as other validations in the Emboss compiler, providing a specific file, line, and column range of the issue and printing the line containing the issue to the user.