Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libutil Add a new non-terminal "time_numericzone" for a ...
details: https://anonhg.NetBSD.org/src/rev/04040f577bf0
branches: trunk
changeset: 332771:04040f577bf0
user: apb <apb%NetBSD.org@localhost>
date: Wed Oct 08 14:43:48 2014 +0000
description:
Add a new non-terminal "time_numericzone" for a time with
a numeric timezone. Move some productions from "time" to "time_numericzone".
Increment yyHaveZone when encountering one of these.
Previously, input of the form "HH:MM:SS +ZZZZ" would not have set the
yyhaveZone flag.
diffstat:
lib/libutil/parsedate.y | 36 +++++++++++++++++++++---------------
1 files changed, 21 insertions(+), 15 deletions(-)
diffs (73 lines):
diff -r b5d3beaa9bd0 -r 04040f577bf0 lib/libutil/parsedate.y
--- a/lib/libutil/parsedate.y Wed Oct 08 14:32:29 2014 +0000
+++ b/lib/libutil/parsedate.y Wed Oct 08 14:43:48 2014 +0000
@@ -14,7 +14,7 @@
#include <sys/cdefs.h>
#ifdef __RCSID
-__RCSID("$NetBSD: parsedate.y,v 1.18 2014/10/08 14:32:29 apb Exp $");
+__RCSID("$NetBSD: parsedate.y,v 1.19 2014/10/08 14:43:48 apb Exp $");
#endif
#include <stdio.h>
@@ -118,6 +118,10 @@
item : time {
param->yyHaveTime++;
}
+ | time_numericzone {
+ param->yyHaveTime++;
+ param->yyHaveZone++;
+ }
| zone {
param->yyHaveZone++;
}
@@ -197,19 +201,28 @@
param->yySeconds = 0;
param->yyMeridian = $4;
}
- | tUNUMBER ':' tUNUMBER tSNUMBER {
+ | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
+ param->yyHour = $1;
+ param->yyMinutes = $3;
+ param->yySeconds = $5;
+ param->yyMeridian = $6;
+ }
+ | tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER {
+ param->yyHour = $1;
+ param->yyMinutes = $3;
+ param->yySeconds = $5;
+ param->yyMeridian = MER24;
+/* XXX: Do nothing with millis */
+ }
+ ;
+
+time_numericzone : tUNUMBER ':' tUNUMBER tSNUMBER {
param->yyHour = $1;
param->yyMinutes = $3;
param->yyMeridian = MER24;
param->yyDSTmode = DSToff;
param->yyTimezone = - ($4 % 100 + ($4 / 100) * 60);
}
- | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
- param->yyHour = $1;
- param->yyMinutes = $3;
- param->yySeconds = $5;
- param->yyMeridian = $6;
- }
| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER {
param->yyHour = $1;
param->yyMinutes = $3;
@@ -218,13 +231,6 @@
param->yyDSTmode = DSToff;
param->yyTimezone = - ($6 % 100 + ($6 / 100) * 60);
}
- | tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER {
- param->yyHour = $1;
- param->yyMinutes = $3;
- param->yySeconds = $5;
- param->yyMeridian = MER24;
-/* XXX: Do nothing with millis */
- }
;
zone : tZONE {
Home |
Main Index |
Thread Index |
Old Index