X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/52cfdad5862a445c59093edd504338f4e762057c..937ee92013bed7b3ebd30fff2c17a751d37b1a61:/sbr/dtimep.l?ds=sidebyside diff --git a/sbr/dtimep.l b/sbr/dtimep.l index d2483769..e9dd8153 100644 --- a/sbr/dtimep.l +++ b/sbr/dtimep.l @@ -35,7 +35,7 @@ */ #define YY_DECL struct tws *dparsetime(char *lexstr) - /* yyerminate() is called after the input string is matched to + /* yyterminate() is called after the input string is matched to * completion (actually, when the lexer reaches an EOF). The only * thing that really needs to be in this macro function is the * return call, which must be substituted inline into dparsetime. @@ -159,7 +159,6 @@ static int day_map[] = { #define SKIPTOSP() { while ( !isspace((unsigned char) *cp++) ) ; \ --cp; } -#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST # ifdef HAVE_SYS_TIME_H # include # endif @@ -179,35 +178,34 @@ zonehack (struct tws *tw) tw->tw_zone -= 60; } } -#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ %} -sun ([Ss]un(day)?) -mon ([Mm]on(day)?) -tue ([Tt]ue(sday)?) -wed ([Ww]ed(nesday)?) -thu ([Tt]hu(rsday)?) -fri ([Ff]ri(day)?) -sat ([Ss]at(urday)?) +sun [Ss]un(day)? +mon [Mm]on(day)? +tue [Tt]ue(sday)? +wed [Ww]ed(nesday)? +thu [Tt]hu(rsday)? +fri [Ff]ri(day)? +sat [Ss]at(urday)? -DAY ({sun}|{mon}|{tue}|{wed}|{thu}|{fri}|{sat}) +DAY {sun}|{mon}|{tue}|{wed}|{thu}|{fri}|{sat} -jan ([Jj]an(uary)?) -feb ([Ff]eb(ruary)?) -mar ([Mm]ar(ch)?) -apr ([Aa]pr(il)?) -may ([Mm]ay) -jun ([Jj]un(e)?) -jul ([Jj]ul(y)?) -aug ([Aa]ug(ust)?) -sep ([Ss]ep(tember)?) -oct ([Oo]ct(ober)?) -nov ([Nn]ov(ember)?) -dec ([Dd]ec(ember)?) +jan [Jj]an(uary)? +feb [Ff]eb(ruary)? +mar [Mm]ar(ch)? +apr [Aa]pr(il)? +may [Mm]ay +jun [Jj]une? +jul [Jj]uly? +aug [Aa]ug(ust)? +sep [Ss]ep(tember)? +oct [Oo]ct(ober)? +nov [Nn]ov(ember)? +dec [Dd]ec(ember)? -MONTH ({jan}|{feb}|{mar}|{apr}|{may}|{jun}|{jul}|{aug}|{sep}|{oct}|{nov}|{dec}) +MONTH {jan}|{feb}|{mar}|{apr}|{may}|{jun}|{jul}|{aug}|{sep}|{oct}|{nov}|{dec} -TIME ({D}:{d}{d}(:{d}{d})?) +TIME {D}:{d}{d}(:{d}{d})? /* The year can either be 2 digits, or 4. However, after Y2K, we found that some MUA were reporting the year 100, hence @@ -215,11 +213,11 @@ TIME ({D}:{d}{d}(:{d}{d})?) issues with 2-digit years. */ -YEAR (({d}{d})|(1{d}{d})|({d}{4})) +YEAR ({d}{d})|(1{d}{d})|({d}{4}) -w ([ \t]*) -W ([ \t]+) -D ([0-9]?[0-9]) +w [ \t]* +W [ \t]+ +D [0-9]?[0-9] d [0-9] nl [ \t\n()] @@ -341,18 +339,14 @@ nl [ \t\n()] INIT(); SKIPTOD(); SETZONE(atoi(cp)); -#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); -#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ yyterminate(); } "-"{D}{d}{d} { INIT(); SKIPTOD(); SETZONE(-atoi(cp)); -#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); -#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ yyterminate(); }