/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
ds_init_empty (&text);
ds_put_char (&text, '(');
- if (i->first_column != 0)
- {
- if (i->first_column == i->last_column - 1)
- ds_put_format (&text, _("column %d"), i->first_column);
- else
- ds_put_format (&text, _("columns %d-%d"),
- i->first_column, i->last_column - 1);
- ds_put_cstr (&text, ", ");
- }
ds_put_format (&text, _("%s field) "), fmt_name (i->format));
ds_put_vformat (&text, format, args);
m.text = ds_cstr (&text);
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = i->first_column;
+ m.where.last_column = i->last_column;
msg_emit (&m);
}
m.severity = MSG_S_ERROR;
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = 0;
+ m.where.last_column = 0;
m.text = ds_cstr (&text);
msg_emit (&m);
m.severity = MSG_S_WARNING;
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = 0;
+ m.where.last_column = 0;
m.text = ds_cstr (&text);
msg_emit (&m);
m.severity = msg_class_to_severity (class);
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = 0;
+ m.where.last_column = 0;
m.text = ds_cstr (&text);
msg_emit (&m);
/* PSPP - a program for statistical analysis.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
m.text = xvasprintf (format, args);
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = 0;
+ m.where.last_column = 0;
va_end (args);
msg_emit (&m);
m.text = xvasprintf (format, args);
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = 0;
+ m.where.last_column = 0;
va_end (args);
msg_emit (&m);
ds_init_empty (&s);
if (m->category != MSG_C_GENERAL
- && (m->where.file_name || m->where.line_number != -1))
+ && (m->where.file_name
+ || m->where.line_number > 0
+ || m->where.first_column > 0))
{
if (m->where.file_name)
- ds_put_format (&s, "%s:", m->where.file_name);
+ ds_put_format (&s, "%s", m->where.file_name);
if (m->where.line_number > 0)
- ds_put_format (&s, "%d:", m->where.line_number);
- ds_put_char (&s, ' ');
+ {
+ if (!ds_is_empty (&s))
+ ds_put_char (&s, ':');
+ ds_put_format (&s, "%d", m->where.line_number);
+ }
+ if (m->where.first_column > 0)
+ {
+ ds_put_format (&s, ".%d", m->where.first_column);
+ if (m->where.last_column > m->where.first_column + 1)
+ ds_put_format (&s, "-%d", m->where.last_column - 1);
+ }
+ ds_put_cstr (&s, ": ");
}
switch (m->severity)
m.severity = MSG_S_NOTE;
m.where.file_name = NULL;
m.where.line_number = 0;
+ m.where.first_column = 0;
+ m.where.last_column = 0;
m.text = s;
msg_handler (&m);
free (s);
msg_emit (struct msg *m)
{
if ( s_stream )
- get_msg_location (s_stream, &m->where);
+ {
+ struct msg_locator loc;
+
+ get_msg_location (s_stream, &loc);
+ m->where.file_name = loc.file_name;
+ m->where.line_number = loc.line_number;
+ }
else
{
m->where.file_name = NULL;
{
char *file_name; /* File name (NULL if none). */
int line_number; /* Line number (0 if none). */
+ int first_column; /* 1-based column number (0 if none). */
+ int last_column; /* 1-based exclusive last column (0 if none). */
};
/* A message. */
C,F8.0
D,F8.0
-"data-list.pspp:3: warning: (columns 9-13, F field) Number followed by garbage."
+data-list.pspp:3.9-13: warning: Data for variable D is not valid as format F: Number followed by garbage.
Table: Data List
A,B,C,D
list.
])
AT_CHECK([pspp -O format=csv data-list.pspp], [0], [dnl
-"data-list.pspp:4: warning: (column 6, F field) Field contents are not numeric."
+data-list.pspp:4.6: warning: Data for variable D is not valid as format F: Field contents are not numeric.
Table: Data List
A,B,C,D
list.
])
AT_CHECK([pspp -O format=csv data-list.pspp], [0], [dnl
-"data-list.pspp:8: warning: (columns 1-3, F field) Field contents are not numeric."
+data-list.pspp:8.1-3: warning: Data for variable count is not valid as format F: Field contents are not numeric.
-"data-list.pspp:11: warning: (columns 1-3, F field) Field contents are not numeric."
+data-list.pspp:11.1-3: warning: Data for variable count is not valid as format F: Field contents are not numeric.
Table: Data List
start,end,count
])
AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
-"set.pspp:5: warning: (column 3, F field) Field contents are not numeric."
+set.pspp:5.3: warning: Data for variable y is not valid as format F: Field contents are not numeric.
-"set.pspp:6: warning: (column 3, F field) Field contents are not numeric."
+set.pspp:6.3: warning: Data for variable y is not valid as format F: Field contents are not numeric.
-"set.pspp:7: warning: (column 1, F field) Field contents are not numeric."
+set.pspp:7.1: warning: Data for variable x is not valid as format F: Field contents are not numeric.
note: Warnings (3) exceed limit (2). Syntax processing will be halted.
])