Add support for /*..*/ comments to idparse

This commit is contained in:
Bill Currie 2012-06-23 19:43:22 +09:00
parent 409604ebfd
commit 7b231bc70e

View file

@ -109,11 +109,21 @@ skipwhite:
com_token = _com_token->str;
return 0;
}
// skip // coments
if (data[0] == '/' && data[1] == '/') {
while (*data && *data != '\n')
data++;
goto skipwhite;
}
// skip /*..*/ comments
if (data[0] == '/' && data[1] == '*') {
data += 2; // skip over the leading /*
while (data[0] && (data[0] != '*' && data[1] != '/'))
data++;
if (data[0])
data +=2; // skip over the trailing */
goto skipwhite;
}
if (*data == '"') {
data++;
i = 0;