]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Improve calendar file parsing and consistency tests
authorStefan Eßer <se@FreeBSD.org>
Sat, 31 Oct 2020 15:11:24 +0000 (15:11 +0000)
committerStefan Eßer <se@FreeBSD.org>
Sat, 31 Oct 2020 15:11:24 +0000 (15:11 +0000)
commit8e8c5da47fdbe10ea37cdc999f88a6b4b8714147
tree12f1a2beb50841250dd284c0a76d55a4ec216f6a
parent6688708624f1298d9b2f86a780d8a69d0b3d0058
Improve calendar file parsing and consistency tests

Add line number information to more warning and error messages.
Detect #else and #endif without corresponing #ifdef/#ifndef as error.
Detect missing #endif at end of file and print warning but continue.

Support for #undef has been added to reverse the effect of a prior #define.
It is no error if the argument value has not been defined before.

These changes may cause error aborts on malformed input files (e.g. with
spurious #else or #endif), but no such errors exist in the calendar files
in the FreeBSD base system and the calendar-data port and all tests pass.

More tests will be added in a follow-up commit to detect regressions that
might affect the newly added features.

This commit ends a series of updates that enhance the pre-processor and
make it behave much more like prior versions of the calendar progarm that
called cpp to pre-process the data files.

MFC after: 3 days
Relnotes: yes
usr.bin/calendar/io.c