Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

Delimiter character isn't the correct one for the delimiter's position in the string

Scott Smith edited this page Mar 17, 2018 · 3 revisions

The fully-formatted error message

An unexpected delimiter, '?', was encountered after the 'day-of-month' digits ('29'):

          1992-05-29?12:25:12.1-01:00
                  ^^X

A 'T' belongs in that position.

Substitutions

Name Value Type Source
Input 1992-05-29?12:25:12.1-01:00 String The ISO8601 string being parsed
Expected 'T' Char What the parse command is looking for
Actual '?' Char What the parse found
PreviousName "day-of-month" String The name of the field immediately preceding the erroneous delimiter
PreviousValue 29 String or Int The value of the immediately preceding field
PreviousType digits String "digits" or "delimiter"
PreviousStartOffset 9 Int The displacement from the start of the string being parsed to locate the leftmost '^'
PreviousCharCount 2 Int The number of '^' chars to position under the previous value
TopLine "An unexpected delimiter, '?', was encountered after the '?' digits (?):" String This error category
BottomLine "A '?' belongs in that position." String This error category

Notes

  1. The Value column above describes the example values in the sample error message above.
  2. The offset of the actual error position is calculated: it is always after the sum of the PreviousStartOffset and the PreviousCharCount.
  3. Here the number of 'X' is one. But Digit sequence has wrong length has no 'X' because the error field is the first one.
  4. Note that TopLine and BottomLine have '?' marking where values will be substituted.
  5. I'm wondering if the type of the preceding field can be automatically derived.