Age | Commit message (Collapse) | Author |
|
|
|
|
|
(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.
|
|
|
|
(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.
|
|
|
|
From Michael Stone.
|
|
|
|
be before 2.8; this is needed for OPENStep 4.2 cc. Also,
define to empty if strict ANSI.
|
|
tMINUTE_UNIT to tUNUMBER. From Urs Thuermann.
|
|
|
|
|
|
(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.
|
|
`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.
|
|
|
|
have an absolute timestamp, or if the relative timestamp
mentions days, months, or years.
|
|
(LookupWord, yylex): Don't pass negative char to ctype macros.
|
|
|
|
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.
|
|
The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
|
|
(__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.
|
|
|
|
|
|
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.
|
|
Patch from Richard Sharman <rsharman@magmacom.com>.
|
|
|
|
From Andreas Schwab.
|
|
(tDAY_UNIT): Likewise for yyRelDay.
(tHOUR_UNIT): Likewise for yyRelHour.
(tMINUTE_UNIT): Likewise for yyRelMinutes.
(tSEC_UNIT): Likewise for yyRelSeconds.
|
|
|
|
|
|
Indent cpp-directives to reflect nesting.
|
|
* 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.
|
|
|
|
(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.
|
|
Some fit in 31 bits.
|
|
if L >= 1000, otherwise as MM/DD/YY. With this change,
date --date=DATE accepts dates like those in an RCS log listing.
|
|
Suggestion to do as in gdb/c-exp.y from Tom Tromey.
|
|
From Bruno Haible.
|
|
|
|
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).
|
|
|
|
Otherwise years after 1999 are treated as invalid.
From Andreas Schwab.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|