commit
5cff02a725
|
@ -199,18 +199,18 @@ class EtagsPrinter : ASTVisitor
|
||||||
maketag(name.text, name.index, name.line);
|
maketag(name.text, name.index, name.line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void maketag(string text, ulong index, ulong line)
|
void maketag(string text, size_t index, ulong line)
|
||||||
{
|
{
|
||||||
// skip declaration in unittests and funcs
|
// skip declaration in unittests and funcs
|
||||||
if (inUnittest || inFunc) return;
|
if (inUnittest || inFunc) return;
|
||||||
|
|
||||||
// tag is a searchable string from beginning of line
|
// tag is a searchable string from beginning of line
|
||||||
ulong b = index;
|
size_t b = index;
|
||||||
while (b > 0 && bytes[--b] != '\n') {}
|
while (b > 0 && bytes[--b] != '\n') {}
|
||||||
++b;
|
++b;
|
||||||
|
|
||||||
// tag end is one char beyond tag name
|
// tag end is one char beyond tag name
|
||||||
ulong e = index + text.length;
|
size_t e = index + text.length;
|
||||||
if (e < bytes.length && bytes[e] != '\n') ++e;
|
if (e < bytes.length && bytes[e] != '\n') ++e;
|
||||||
|
|
||||||
auto tag = cast(char[])bytes[b..e];
|
auto tag = cast(char[])bytes[b..e];
|
||||||
|
|
Loading…
Reference in New Issue