+/* Parses a BASE-based column using LEXER. Returns true and
+ stores a 1-based column number into *COLUMN if successful,
+ otherwise emits an error message and returns false. */
+static bool
+parse_column (int value, int base, int *column)
+{
+ assert (base == 0 || base == 1);
+ *column = value - base + 1;
+ if (*column < 1)
+ {
+ if (base == 1)
+ msg (SE, _("Column positions for fields must be positive."));
+ else
+ msg (SE, _("Column positions for fields must not be negative."));
+ return false;
+ }
+ return true;
+}
+