"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/location.c" between
bison-3.8.1.tar.xz and bison-3.8.2.tar.xz

About: Bison is a general-purpose parser generator.

location.c  (bison-3.8.1.tar.xz):location.c  (bison-3.8.2.tar.xz)
skipping to change at line 513 skipping to change at line 513
putc ('\n', out); putc ('\n', out);
} }
bool bool
location_empty (location loc) location_empty (location loc)
{ {
return !loc.start.file && !loc.start.line && !loc.start.column return !loc.start.file && !loc.start.line && !loc.start.column
&& !loc.end.file && !loc.end.line && !loc.end.column; && !loc.end.file && !loc.end.line && !loc.end.column;
} }
static inline int
str_to_int (const char *s)
{
long l = strtol (s, NULL, 10);
return l < 0 ? -1 : l <= INT_MAX ? l : INT_MAX;
}
void void
boundary_set_from_string (boundary *bound, char *str) boundary_set_from_string (boundary *bound, char *str)
{ {
/* Must search in reverse since the file name field may contain '.' /* Search backwards: the file name may contain '.' or ':'. */
or ':'. */
char *at = strrchr (str, '@'); char *at = strrchr (str, '@');
if (at) if (at)
{ {
*at = '\0'; *at = '\0';
bound->byte = atoi (at+1); bound->byte = str_to_int (at + 1);
} }
{ {
char *dot = strrchr (str, '.'); char *dot = strrchr (str, '.');
aver (dot); aver (dot);
*dot = '\0'; *dot = '\0';
bound->column = atoi (dot+1); bound->column = str_to_int (dot + 1);
if (!at) if (!at)
bound->byte = bound->column; bound->byte = bound->column;
} }
{ {
char *colon = strrchr (str, ':'); char *colon = strrchr (str, ':');
aver (colon); aver (colon);
*colon = '\0'; *colon = '\0';
bound->line = atoi (colon+1); bound->line = str_to_int (colon + 1);
} }
bound->file = uniqstr_new (str); bound->file = uniqstr_new (str);
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)