From: Peter Verthez Date: Sun, 9 Feb 2003 09:27:42 +0000 (+0000) Subject: More verbosity in date errors. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=681b182b6f003e91a47a098b7e8ac632315f61a6;p=gedcom-parse.git More verbosity in date errors. --- diff --git a/gedcom/date.c b/gedcom/date.c index 9c086e7..19fd434 100644 --- a/gedcom/date.c +++ b/gedcom/date.c @@ -425,7 +425,8 @@ struct date_value gedcom_parse_date(const char* line_value) result |= numbers_to_sdn(&dv_s.date2); } if (result != 0) { - gedcom_date_error(_("Putting date in 'phrase' member")); + gedcom_date_error(_("Putting date '%s' in 'phrase' member"), + curr_line_value); make_date_value(DV_PHRASE, &dv_s.date1, &dv_s.date2, curr_line_value); } return dv_s; diff --git a/gedcom/gedcom_date.y b/gedcom/gedcom_date.y index e38769e..a8c829c 100644 --- a/gedcom/gedcom_date.y +++ b/gedcom/gedcom_date.y @@ -126,7 +126,7 @@ date_value : date { make_date_value(DV_NO_MODIFIER, } | error { /* On error: put entire string in 'phrase' member as fallback */ - gedcom_date_error(_("Putting date in 'phrase' member")); + gedcom_date_error(_("Putting date '%s' in 'phrase' member"), curr_line_value); make_date_value(DV_PHRASE, &def_date, &def_date, curr_line_value); YYABORT; diff --git a/t/output/compat-famorig.ref b/t/output/compat-famorig.ref index 5c6987b..21607c0 100644 --- a/t/output/compat-famorig.ref +++ b/t/output/compat-famorig.ref @@ -141,7 +141,7 @@ Rec INDI start, xref is @I71@ == 1 NOTE (348) twin, probably unmarried. (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 97: Error converting date: year 1739, month 2, day 29 -WARNING: Warning on line 97: Putting date in 'phrase' member +WARNING: Warning on line 97: Putting date '29 FEB 1739' in 'phrase' member Contents of the date_value: raw value: 29 FEB 1739 type: 11 @@ -355,7 +355,7 @@ Rec INDI start, xref is @I71@ == 1 NOTE (348) twin, probably unmarried. (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 97: Error converting date: year 1739, month 2, day 29 -WARNING: Warning on line 97: Putting date in 'phrase' member +WARNING: Warning on line 97: Putting date '29 FEB 1739' in 'phrase' member Contents of the date_value: raw value: 29 FEB 1739 type: 11 diff --git a/t/output/compat-lifelines.ref b/t/output/compat-lifelines.ref index 0e229cf..9ff5da7 100644 --- a/t/output/compat-lifelines.ref +++ b/t/output/compat-lifelines.ref @@ -20,7 +20,7 @@ Family start, xref is @F1@ == 1 HUSB (330) @I7@ (ctxt is 1, conversion failures: 0) == 1 MARR (339) (null) (ctxt is 1, conversion failures: 0) WARNING: Warning on line 9: Empty value changed to '-' -WARNING: Warning on line 9: Putting date in 'phrase' member +WARNING: Warning on line 9: Putting date '-' in 'phrase' member Contents of the date_value: raw value: - type: 11 @@ -73,7 +73,7 @@ Contents of the date_value: == 2 SOUR (377) ongeveer 1360 (ctxt is 333, conversion failures: 0) == 1 DEAT (307) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 21: Empty value changed to '-' -WARNING: Warning on line 21: Putting date in 'phrase' member +WARNING: Warning on line 21: Putting date '-' in 'phrase' member Contents of the date_value: raw value: - type: 11 @@ -123,7 +123,7 @@ Family start, xref is @F1@ == 1 HUSB (330) @I7@ (ctxt is 2, conversion failures: 0) == 1 MARR (339) (null) (ctxt is 2, conversion failures: 0) WARNING: Warning on line 9: Empty value changed to '-' -WARNING: Warning on line 9: Putting date in 'phrase' member +WARNING: Warning on line 9: Putting date '-' in 'phrase' member Contents of the date_value: raw value: - type: 11 @@ -176,7 +176,7 @@ Contents of the date_value: == 2 SOUR (377) ongeveer 1360 (ctxt is 333, conversion failures: 0) == 1 DEAT (307) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 21: Empty value changed to '-' -WARNING: Warning on line 21: Putting date in 'phrase' member +WARNING: Warning on line 21: Putting date '-' in 'phrase' member Contents of the date_value: raw value: - type: 11 diff --git a/t/output/compat-paf2.ref b/t/output/compat-paf2.ref index 2462019..9dbb289 100644 --- a/t/output/compat-paf2.ref +++ b/t/output/compat-paf2.ref @@ -26701,7 +26701,7 @@ Rec INDI start, xref is @I716@ == 1 SEX (374) F (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 6436: Year is missing: '10 JAN' -WARNING: Warning on line 6436: Putting date in 'phrase' member +WARNING: Warning on line 6436: Putting date '10 JAN' in 'phrase' member Contents of the date_value: raw value: 10 JAN type: 11 @@ -49598,7 +49598,7 @@ Rec INDI start, xref is @I1384@ == 1 SEX (374) M (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 12060: Year after slash should be following year: '1056/60' -WARNING: Warning on line 12060: Putting date in 'phrase' member +WARNING: Warning on line 12060: Putting date ' 1056/1060' in 'phrase' member Contents of the date_value: raw value: 1056/1060 type: 11 @@ -50119,7 +50119,7 @@ Rec INDI start, xref is @I1398@ == 1 SEX (374) F (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 12199: Year after slash should be following year: '1103/05' -WARNING: Warning on line 12199: Putting date in 'phrase' member +WARNING: Warning on line 12199: Putting date 'ABT 1103/1105' in 'phrase' member Contents of the date_value: raw value: ABT 1103/1105 type: 11 @@ -99336,7 +99336,7 @@ Family start, xref is @F602@ == 1 WIFE (392) @I1369@ (ctxt is 602, conversion failures: 0) == 1 MARR (339) (null) (ctxt is 602, conversion failures: 0) WARNING: Warning on line 27126: Year is missing: '20 JUL' -WARNING: Warning on line 27126: Putting date in 'phrase' member +WARNING: Warning on line 27126: Putting date '20 JUL' in 'phrase' member Contents of the date_value: raw value: 20 JUL type: 11 @@ -135173,7 +135173,7 @@ Rec INDI start, xref is @I716@ == 1 SEX (374) F (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 6436: Year is missing: '10 JAN' -WARNING: Warning on line 6436: Putting date in 'phrase' member +WARNING: Warning on line 6436: Putting date '10 JAN' in 'phrase' member Contents of the date_value: raw value: 10 JAN type: 11 @@ -158070,7 +158070,7 @@ Rec INDI start, xref is @I1384@ == 1 SEX (374) M (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 12060: Year after slash should be following year: '1056/60' -WARNING: Warning on line 12060: Putting date in 'phrase' member +WARNING: Warning on line 12060: Putting date ' 1056/1060' in 'phrase' member Contents of the date_value: raw value: 1056/1060 type: 11 @@ -158591,7 +158591,7 @@ Rec INDI start, xref is @I1398@ == 1 SEX (374) F (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 12199: Year after slash should be following year: '1103/05' -WARNING: Warning on line 12199: Putting date in 'phrase' member +WARNING: Warning on line 12199: Putting date 'ABT 1103/1105' in 'phrase' member Contents of the date_value: raw value: ABT 1103/1105 type: 11 @@ -207808,7 +207808,7 @@ Family start, xref is @F602@ == 1 WIFE (392) @I1369@ (ctxt is 2024, conversion failures: 0) == 1 MARR (339) (null) (ctxt is 2024, conversion failures: 0) WARNING: Warning on line 27126: Year is missing: '20 JUL' -WARNING: Warning on line 27126: Putting date in 'phrase' member +WARNING: Warning on line 27126: Putting date '20 JUL' in 'phrase' member Contents of the date_value: raw value: 20 JUL type: 11 diff --git a/t/output/dates.ref b/t/output/dates.ref index b21599f..485229e 100644 --- a/t/output/dates.ref +++ b/t/output/dates.ref @@ -154,7 +154,7 @@ Rec INDI start, xref is @PERS06@ == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 37: Unknown calendar type WARNING: Warning on line 37: parse error -WARNING: Warning on line 37: Putting date in 'phrase' member +WARNING: Warning on line 37: Putting date '@#DFRENCH@ 03 BRUM 4' in 'phrase' member Contents of the date_value: raw value: @#DFRENCH@ 03 BRUM 4 type: 11 @@ -271,7 +271,7 @@ Rec INDI start, xref is @PERS11@ == 1 NAME (342) /Invalid date/ (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 57: Error converting date: year 1739, month 2, day 29 -WARNING: Warning on line 57: Putting date in 'phrase' member +WARNING: Warning on line 57: Putting date '29 FEB 1739' in 'phrase' member Contents of the date_value: raw value: 29 FEB 1739 type: 11 @@ -462,7 +462,7 @@ Rec INDI start, xref is @PERS06@ == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 37: Unknown calendar type WARNING: Warning on line 37: parse error -WARNING: Warning on line 37: Putting date in 'phrase' member +WARNING: Warning on line 37: Putting date '@#DFRENCH@ 03 BRUM 4' in 'phrase' member Contents of the date_value: raw value: @#DFRENCH@ 03 BRUM 4 type: 11 @@ -579,7 +579,7 @@ Rec INDI start, xref is @PERS11@ == 1 NAME (342) /Invalid date/ (ctxt is 333, conversion failures: 0) == 1 BIRT (283) (null) (ctxt is 333, conversion failures: 0) WARNING: Warning on line 57: Error converting date: year 1739, month 2, day 29 -WARNING: Warning on line 57: Putting date in 'phrase' member +WARNING: Warning on line 57: Putting date '29 FEB 1739' in 'phrase' member Contents of the date_value: raw value: 29 FEB 1739 type: 11 diff --git a/t/output/dates_gom.ref b/t/output/dates_gom.ref index 576504f..b301c0e 100644 --- a/t/output/dates_gom.ref +++ b/t/output/dates_gom.ref @@ -2,9 +2,9 @@ === Parsing file dates.ged Warning on line 37: Unknown calendar type Warning on line 37: parse error -Warning on line 37: Putting date in 'phrase' member +Warning on line 37: Putting date '@#DFRENCH@ 03 BRUM 4' in 'phrase' member Warning on line 57: Error converting date: year 1739, month 2, day 29 -Warning on line 57: Putting date in 'phrase' member +Warning on line 57: Putting date '29 FEB 1739' in 'phrase' member Warning: Cross-reference @PERS07@ defined on line 38 is never used Warning: Cross-reference @PERS02@ defined on line 18 is never used Warning: Cross-reference @PERS00@ defined on line 10 is never used diff --git a/t/output/write_gom_compat-famorig.ref b/t/output/write_gom_compat-famorig.ref index b83f79c..1a76a8e 100644 --- a/t/output/write_gom_compat-famorig.ref +++ b/t/output/write_gom_compat-famorig.ref @@ -1,6 +1,6 @@ WARNING: Warning on line 5: Enabling compatibility with 'Family Origins' WARNING: Warning on line 97: Error converting date: year 1739, month 2, day 29 -WARNING: Warning on line 97: Putting date in 'phrase' member +WARNING: Warning on line 97: Putting date '29 FEB 1739' in 'phrase' member WARNING: Warning: Cross-reference @I1@ defined on line 22 is never used Writing file... Re-parsing file... diff --git a/t/output/write_gom_compat-lifelines.ref b/t/output/write_gom_compat-lifelines.ref index ad97676..46f9d44 100644 --- a/t/output/write_gom_compat-lifelines.ref +++ b/t/output/write_gom_compat-lifelines.ref @@ -2,9 +2,9 @@ WARNING: Warning on line 2: Enabling compatibility with 'Lifelines' WARNING: Warning on line 5: Header change time '17:43' lost in the compatibility (out of context) WARNING: Warning on line 5: Adding link to submitter record with xref '@__COMPAT__SUBM__@' WARNING: Warning on line 9: Empty value changed to '-' -WARNING: Warning on line 9: Putting date in 'phrase' member +WARNING: Warning on line 9: Putting date '-' in 'phrase' member WARNING: Warning on line 21: Empty value changed to '-' -WARNING: Warning on line 21: Putting date in 'phrase' member +WARNING: Warning on line 21: Putting date '-' in 'phrase' member Writing file... Re-parsing file... Test succeeded diff --git a/t/output/write_gom_compat-paf2.ref b/t/output/write_gom_compat-paf2.ref index 6007533..724c315 100644 --- a/t/output/write_gom_compat-paf2.ref +++ b/t/output/write_gom_compat-paf2.ref @@ -2,13 +2,13 @@ WARNING: Warning on line 2: Enabling compatibility with 'Personal Ancestral File WARNING: Warning on line 6: Adding link to submitter record with xref '@__COMPAT__SUBM__@' WARNING: Warning on line 13: Converting non-standard tag 'COMM' to user tag '_COMM' WARNING: Warning on line 6436: Year is missing: '10 JAN' -WARNING: Warning on line 6436: Putting date in 'phrase' member +WARNING: Warning on line 6436: Putting date '10 JAN' in 'phrase' member WARNING: Warning on line 12060: Year after slash should be following year: '1056/60' -WARNING: Warning on line 12060: Putting date in 'phrase' member +WARNING: Warning on line 12060: Putting date ' 1056/1060' in 'phrase' member WARNING: Warning on line 12199: Year after slash should be following year: '1103/05' -WARNING: Warning on line 12199: Putting date in 'phrase' member +WARNING: Warning on line 12199: Putting date 'ABT 1103/1105' in 'phrase' member WARNING: Warning on line 27126: Year is missing: '20 JUL' -WARNING: Warning on line 27126: Putting date in 'phrase' member +WARNING: Warning on line 27126: Putting date '20 JUL' in 'phrase' member WARNING: Warning: Cross-reference @I359@ defined on line 3543 is never used WARNING: Warning: Cross-reference @S1@ defined on line 7 is never used WARNING: Warning: Cross-reference @I970@ defined on line 8497 is never used diff --git a/t/output/write_gom_dates.ref b/t/output/write_gom_dates.ref index 4aca811..9c5f50e 100644 --- a/t/output/write_gom_dates.ref +++ b/t/output/write_gom_dates.ref @@ -1,8 +1,8 @@ WARNING: Warning on line 37: Unknown calendar type WARNING: Warning on line 37: parse error -WARNING: Warning on line 37: Putting date in 'phrase' member +WARNING: Warning on line 37: Putting date '@#DFRENCH@ 03 BRUM 4' in 'phrase' member WARNING: Warning on line 57: Error converting date: year 1739, month 2, day 29 -WARNING: Warning on line 57: Putting date in 'phrase' member +WARNING: Warning on line 57: Putting date '29 FEB 1739' in 'phrase' member WARNING: Warning: Cross-reference @PERS07@ defined on line 38 is never used WARNING: Warning: Cross-reference @PERS02@ defined on line 18 is never used WARNING: Warning: Cross-reference @PERS00@ defined on line 10 is never used