]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Improve calendar file parsing and consistency tests
authorse <se@FreeBSD.org>
Sat, 31 Oct 2020 15:11:24 +0000 (15:11 +0000)
committerse <se@FreeBSD.org>
Sat, 31 Oct 2020 15:11:24 +0000 (15:11 +0000)
commit3c56c838d5e6c3238275c6bca8ce8cda4e36653d
tree12f1a2beb50841250dd284c0a76d55a4ec216f6a
parent2322700bfbc81f2eca53605e64dc4bb43f289ab9
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