[fidlc] Fix error reporting on line/file bounds
This change brings in fixes for how the fidlc front-end handles spans and source context, especially on the boundaries of a line or file. This is the underlying cause of FIDL-583. In more detail, this change: * Enables proper pretty printing of start-of-file, start-of-line, end-of-line, and end-of-file spans. * Fixes a bug in the line-splitting logic of the internal compiler SourceFile representation. * Adds unit tests to cover empty file and unexpected EOF token cases. FIDL-583 #done Test: Add new unit tests to cover the cases being fixed. Run old tests to make sure nothing is broken by this. Change-Id: I4a23916a6264df9b0ebced6764e3f9a573793a19
Showing
- zircon/system/host/fidl/include/fidl/source_file.h 9 additions, 0 deletionszircon/system/host/fidl/include/fidl/source_file.h
- zircon/system/host/fidl/lib/error_reporter.cpp 15 additions, 10 deletionszircon/system/host/fidl/lib/error_reporter.cpp
- zircon/system/host/fidl/lib/source_file.cpp 34 additions, 3 deletionszircon/system/host/fidl/lib/source_file.cpp
- zircon/system/host/fidl/lib/virtual_source_file.cpp 3 additions, 1 deletionzircon/system/host/fidl/lib/virtual_source_file.cpp
- zircon/system/utest/fidl-compiler/errors_tests.cpp 26 additions, 0 deletionszircon/system/utest/fidl-compiler/errors_tests.cpp
Loading
Please register or sign in to comment