+/* 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.
+
+ If BASE is 0, zero-based column numbers are parsed; if BASE is
+ 1, 1-based column numbers are parsed. Regardless of BASE, the
+ values stored in *FIRST_COLUMN and *LAST_COLUMN are
+ 1-based. */
+bool
+parse_column (struct lexer *lexer, int base, int *column)
+{
+ assert (base == 0 || base == 1);
+
+ if (!lex_force_int (lexer)
+ || !parse_column__ (lex_integer (lexer), base, column))
+ return false;
+
+ lex_get (lexer);
+ return true;
+}
+