summaryrefslogtreecommitdiff
path: root/lib/getdate.y
AgeCommit message (Collapse)Author
2000-06-15(get_date): Apply relative times after time zone indicator, not before.Jim Meyering
2000-02-22Handle two-digit years with leading zeros correctly.Jim Meyering
(textint): New typedef. (parser_control): Member year changed from int to textint. All uses changed. (YYSTYPE): Removed; replaced by %union with int and textint members. (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>. (tSNUMBER, tUNUMBER): Now of type <textintval>. (date, number, to_year): Use width of number in digits, not its value, to determine whether it's a 2-digit year, or a 2-digit time. (yylex): Store number of digits of numeric tokens. Reported by John Kendall. (parser_control): Changed from struct parser_control to typedef (for consistency). All uses changed. (tID): Removed; not used. (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
2000-01-12Update copyright notice.Jim Meyering
2000-01-06Sync tm_diff with the GNU C Library.Jim Meyering
(TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed. (tm_diff): Renamed from difftm. All uses changed. Replace body with that taken from GNU C Library 2.1.3pre1. (get_date): Prefer tm_gmtoff to tm_diff if available.
1999-12-22rewrite expression (equivalently) at request of Paul EggertJim Meyering
1999-12-22(get_date): Fix typo in time_t overflow test.Jim Meyering
From Michael Stone.
1999-10-31update a comment from alpha.gnu.org:/home/gd/gnu/lib/getdate.yJim Meyering
1999-10-04(__attribute__): Define to empty if GCC claims toJim Meyering
be before 2.8; this is needed for OPENStep 4.2 cc. Also, define to empty if strict ANSI.
1999-08-29(relative_time_table): Change `type' of `THIS' fromJim Meyering
tMINUTE_UNIT to tUNUMBER. From Urs Thuermann.
1999-08-29(get_date): Rename latter local `tm' to probe_tm.Jim Meyering
1999-08-29(get_date): Rename outermost local `probe' to `quarter'.Jim Meyering
1999-08-29Add copyright notice.Jim Meyering
(number): Handle `Nov 11 1996' example; see Risks Digest 20.55 http://catless.ncl.ac.uk/Risks/20.55.html#subj18 (1999-08-27) (<stdio.h>): Include only if testing. (ISUPPER): Remove. (ISLOWER, PC): New macros. (<string.h>): Include if HAVE_STRING_H, not USG. (bcopy): Remove. (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume bison. (EPOCH_YEAR): Renamed from EPOCH. (table): Renamed from TABLE. (meridian): Now an anonymous enum. (struct parser_control): New type. (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros. (yyInput, ..., yyRelYear): Migrated into struct parser_control. (%pure_parser): Added, so that the parser is pure. (%union): Removed; the type is now just plain int. All %type directives removed. (tLOCAL_ZONE): New %token. (month_day_table): Renamed from MonthDayTable. (gmtime, localtime, mktime, time): Declare only if not defined. (meridian_table): New table. (dst_table): New table. (units_table): renamed from UnitsTable. (relative_time_table): Renamed from OtherTable. (time_zone_table): Renamed from TimezoneTable. Modernized data. (military_table): Renamed from MilitaryTable. (to_hour): Renamed from ToHour. (to_year): Renamed from ToYear. (lookup_zone): New function. (LookupWord): Renamed from lookup_word. Use lookup_zone for time zones. (yylex): Now reentrant. All callers changed. (get_date): Add support for local time zone abbreviations. Make it reentrant.
1999-08-07(OtherTable[]): Use tDAY_UNIT for `tomorrow,'Jim Meyering
`yesterday,' `today,' and `now' rather than tMINUTE_UNIT. Of course with correspondingly smaller numbers for tomorrow and yesterday. This change does not change the way the code works, since the grammar rules for the two symbols are analogous.
1999-05-20add the comment to go with last changeJim Meyering
1999-05-20(get_date): Let mktime deduce tm_isdst if weJim Meyering
have an absolute timestamp, or if the relative timestamp mentions days, months, or years.
1999-04-18<stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".Jim Meyering
(LookupWord, yylex): Don't pass negative char to ctype macros.
1999-04-07(difftm): Protoize.Jim Meyering
1999-03-28(get_date): Reuse tm_isdst of first localtimeJim Meyering
call; this is an improvement on a bug fix suggested by martin@dresden.nacamar.de. Do not assume that localtime and gmtime return non-null. From Paul Eggert.
1999-02-19<alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.Jim Meyering
The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
1998-12-31Fix warnings from gcc -W -WallJim Meyering
(__attribute__): Define. (ATTRIBUTE_UNUSED): Define. (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED. (MonthDayTable): Add initializers for last entry. (UnitsTable): Likewise. (OtherTable): Likewise. (MilitaryTable): Likewise.
1998-03-14s/get-date.h/getdate.h/Jim Meyering
1998-02-20s/getdate.h/get-date.h/Jim Meyering
1998-01-06Add %expect directive.Jim Meyering
Move inclusion of getdate.h and dependent extern declarations down so getdate.h's prototype follows the sometimes-enabled definition of `const' to nothing. Otherwise, the prototype wouldn't match the definition because of the defined-away `const'. (get_date): ANSI-fy definition. From Kaveh Ghazi.
1997-06-01(OtherTable): Interpret `next' as 1 (not 2) units.Jim Meyering
Patch from Richard Sharman <rsharman@magmacom.com>.
1997-04-10s/;/. in comment to placate francoisJim Meyering
1997-02-27(tYEAR_UNIT): Increase yyRelYear by $1, not just by 1.Jim Meyering
From Andreas Schwab.
1997-02-22(tMONTH_UNIT): Increase yyRelMonth by $1, not just by 1.Jim Meyering
(tDAY_UNIT): Likewise for yyRelDay. (tHOUR_UNIT): Likewise for yyRelHour. (tMINUTE_UNIT): Likewise for yyRelMinutes. (tSEC_UNIT): Likewise for yyRelSeconds.
1997-01-18Indent with GNU indent.Jim Meyering
1997-01-18Indent 2 more cpp-directives to reflect nesting.Jim Meyering
1997-01-18(get_date): Change prototype to reflect const'ness of parameters.Jim Meyering
Indent cpp-directives to reflect nesting.
1997-01-181997-01-06 Paul Eggert <eggert@twinsun.com>Jim Meyering
* getdate.y: Rewrite to use mktime. <sys/timeb.h>: Don't include. (mktime): Declare. (struct timeb, timezone, DOOMSDAY, SECSPERDAY, DSTMODE, yyDSTmode, ToSeconds, Convert, DSTcorrect, RelativeDate, RelativeMonth): Remove. (ToHour): New function (part of the old ToSeconds fn). (ToYear): New function (part of the old Convert fn). (TABLE.value, yyDayOrdinal, yyDayNumber, yyTimezone, yyDay, yyHour, yyMinutes, yyMonth, yySeconds, yyYear, yyRelMonth, yyRelSeconds, Number): Now int instead of time_t. (HOUR): Don't cast to time_t. (tDAY_UNIT, tHOUR_UNIT, tYEAR_UNIT): New %tokens. (UnitsTable): Use new units that are closer to the keywords. (yyRelDay, yyRelHour, yyRelMinutes, yyRelYear): New variables. (rel, relunit, get_date): Add support for them. (time): Fix timezone calculations for negative half-hour offsets when integer division truncates towards minus infinity. (zone): Incorporiate DST calculation directly. (get_date): 2nd arg is now time_t *, not struct timeb *. Use mktime to do most of the work, instead of computing it ourselves. Guard against falsely reporting errors near the time_t boundaries when parsing times in other time zones.
1996-12-18add blank line.Jim Meyering
1996-12-13(IN_CTYPE_DOMAIN): Rename from ISASCII.Jim Meyering
(ISDIGIT): New definition from Paul Eggert. This one evaluates its argument exactly once. (yylex): Move increment out of ISALPHA argument. Use a comma-expression instead.
1996-12-10(Convert): Don't reject all dates in 2038.Jim Meyering
Some fit in 31 bits.
1996-12-01(date): Interpret the date, L/M/N, as YYYY/MM/DDJim Meyering
if L >= 1000, otherwise as MM/DD/YY. With this change, date --date=DATE accepts dates like those in an RCS log listing.
1996-11-01Remap yacc globals to have gd_ prefix.Jim Meyering
Suggestion to do as in gdb/c-exp.y from Tom Tromey.
1996-09-07Define and use upper case variants of ctype.h IS* macros.Jim Meyering
From Bruno Haible.
1996-03-10Merge changes from FSF.Jim Meyering
1996-03-06(RelativeMonth): Add 1900 to the year so that relative date specsJim Meyering
that push the year through the end of the century work. For example, `date -d "01/01/1998 3 years" +%Y' now prints 2001. From Peter Dalgaard (pd@kubism.ku.dk).
1995-08-07Add FIXME comments.Jim Meyering
1995-06-07(Convert): Use 2037 as threshold, not 1999.Jim Meyering
Otherwise years after 1999 are treated as invalid. From Andreas Schwab.
1995-01-27.Jim Meyering
1995-01-27.Jim Meyering
1995-01-27Remove/rewrite some comments.Jim Meyering
1995-01-27.Jim Meyering
1994-10-08merge with 1.10qJim Meyering
1994-09-27merge with 1.10n1Jim Meyering
1994-09-25.Jim Meyering
1994-09-24merge with 1.10mJim Meyering
1994-09-17merge with 1.10jJim Meyering