1
1

Ticket #267 (etags incorrect get the line number definition)

fix: etags incorrect get the line number of function definition
Этот коммит содержится в:
Ilia Maslakov 2009-08-14 11:13:47 +00:00 коммит произвёл Ilia Maslakov
родитель bf6d6bafb4
Коммит 2289c62c6e

Просмотреть файл

@ -46,7 +46,7 @@
static gboolean parse_define(char *buf, char **long_name, char **short_name, long *line) static gboolean parse_define(char *buf, char **long_name, char **short_name, long *line)
{ {
enum {in_longname, in_shortname, in_line, finish} def_state = in_longname; enum {in_longname, in_shortname, in_shortname_first_char, in_line, finish} def_state = in_longname;
static char longdef[LONG_DEF_LEN]; static char longdef[LONG_DEF_LEN];
static char shortdef[SHORT_DEF_LEN]; static char shortdef[SHORT_DEF_LEN];
@ -69,13 +69,25 @@ static gboolean parse_define(char *buf, char **long_name, char **short_name, lon
} }
} }
break; break;
case in_shortname: case in_shortname_first_char:
if ( isdigit(c) ) { if ( isdigit(c) ) {
nshort = 0; nshort = 0;
buf--; buf--;
def_state = in_line; def_state = in_line;
} else if ( c == 0x01 ) { } else if ( c == 0x01 ) {
def_state = in_line; def_state = in_line;
} else {
if ( nshort < SHORT_DEF_LEN - 1 ) {
shortdef[nshort++] = c;
def_state = in_shortname;
}
}
break;
case in_shortname:
if ( c == 0x01 ) {
def_state = in_line;
} else if ( c == '\n' ) {
def_state = finish;
} else { } else {
if ( nshort < SHORT_DEF_LEN - 1 ) { if ( nshort < SHORT_DEF_LEN - 1 ) {
shortdef[nshort++] = c; shortdef[nshort++] = c;
@ -83,7 +95,7 @@ static gboolean parse_define(char *buf, char **long_name, char **short_name, lon
} }
break; break;
case in_line: case in_line:
if ( c == ',' ) { if ( c == ',' || c == '\n') {
def_state = finish; def_state = finish;
} else if ( isdigit(c) ) { } else if ( isdigit(c) ) {
if ( nline < LINE_DEF_LEN - 1 ) { if ( nline < LINE_DEF_LEN - 1 ) {