]> Savannah Git Hosting - gnulib.git/commit
parse-datetime: add optional debug printing
authorAssaf Gordon <assafgordon@gmail.com>
Sun, 7 Aug 2016 00:08:32 +0000 (20:08 -0400)
committerPádraig Brady <P@draigBrady.com>
Tue, 9 Aug 2016 16:13:11 +0000 (17:13 +0100)
commit12ad79069d831d4fa92ea88bd4b7b39d057ae90f
tree5e264b6774eb9d0ff50ad759a3e1b165916d371e
parent8318f4ae2969c5b75b0edcc26d24c1c4ebe3d783
parse-datetime: add optional debug printing

Print parsing information, warnings, and errors to stderr.

* lib/parse-datetime.h (parse_datetimte_debug): New global variable.
* lib/parse-datetime.y:
(DEBUG_*):  Macros calling debug functions if debugging is enabled.
(PROGRESS*): Same as DEBUG, for progress reporting.
(dbg_printf): Print message to stderr, with 'date' prefix.
(struct parser_control): Add 'debug_*_seen' variables.
(str_days): Converts day ordinal/number to string (e.g. 'last wed').
(debug_print_current_time, debug_print_relateive_time): Prints the
current/relative date/time value of parser_control.
(YACC parser syntax): Print parsed parts with DEBUG_* macros.
(to_year): Warn about 2-digit year parsing.
(yylex):   Warn about unrecognized words.
(get_effective_timezone): Returns current timezone in minutes.
(debug_strf{time,date,datetime}): Convert 'struct tm' to string as
clearly and unambigiously as possible.
(debug_mktime_not_ok): Print detailed information about failed
date/time values.
(parse_datetime): Add DEBUG messages for failures, warnings. Add
PROGRESS messages for status messages.
* modules/parse-datetime: Add 'timegm', 'gettext-h' dependencies.
ChangeLog
lib/parse-datetime.h
lib/parse-datetime.y
modules/parse-datetime