Added destructors, constructors, and invariants to ctags output
This commit is contained in:
parent
9722183249
commit
3798387c19
25
ctags.d
25
ctags.d
|
@ -90,6 +90,26 @@ class CTagsPrinter : ASTVisitor
|
||||||
context = c;
|
context = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override void visit(const Constructor dec)
|
||||||
|
{
|
||||||
|
tagLines ~= "this\t%s\t%d;\"\tf\tarity:%d%s\n".format(fileName,
|
||||||
|
dec.line, dec.parameters.parameters.length, context);
|
||||||
|
auto c = context;
|
||||||
|
context = "\tfunction: this";
|
||||||
|
dec.accept(this);
|
||||||
|
context = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
override void visit(const Destructor dec)
|
||||||
|
{
|
||||||
|
tagLines ~= "~this\t%s\t%d;\"\tf%s\n".format(fileName, dec.line,
|
||||||
|
context);
|
||||||
|
auto c = context;
|
||||||
|
context = "\tfunction: this";
|
||||||
|
dec.accept(this);
|
||||||
|
context = c;
|
||||||
|
}
|
||||||
|
|
||||||
override void visit(const EnumDeclaration dec)
|
override void visit(const EnumDeclaration dec)
|
||||||
{
|
{
|
||||||
if (dec.name == tok!"")
|
if (dec.name == tok!"")
|
||||||
|
@ -136,6 +156,11 @@ class CTagsPrinter : ASTVisitor
|
||||||
dec.accept(this);
|
dec.accept(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override void visit(const Invariant dec)
|
||||||
|
{
|
||||||
|
tagLines ~= "invariant\t%s\t%d;\"\tv%s\n".format(fileName, dec.line, context);
|
||||||
|
}
|
||||||
|
|
||||||
alias visit = ASTVisitor.visit;
|
alias visit = ASTVisitor.visit;
|
||||||
|
|
||||||
string fileName;
|
string fileName;
|
||||||
|
|
|
@ -1239,7 +1239,9 @@ public:
|
||||||
}
|
}
|
||||||
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
|
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
|
||||||
/** */ FunctionBody functionBody;
|
/** */ FunctionBody functionBody;
|
||||||
/** */ size_t location;
|
/** */ size_t line;
|
||||||
|
/** */ size_t column;
|
||||||
|
/** */ size_t index;
|
||||||
/** */ string comment;
|
/** */ string comment;
|
||||||
mixin OpEquals;
|
mixin OpEquals;
|
||||||
}
|
}
|
||||||
|
@ -1780,6 +1782,8 @@ public:
|
||||||
}
|
}
|
||||||
/** */ BlockStatement blockStatement;
|
/** */ BlockStatement blockStatement;
|
||||||
/** */ string comment;
|
/** */ string comment;
|
||||||
|
size_t line;
|
||||||
|
size_t index;
|
||||||
mixin OpEquals;
|
mixin OpEquals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1976,6 +1976,9 @@ class ClassFour(A, B) if (someTest()) : Super {}}c;
|
||||||
node.comment = comment;
|
node.comment = comment;
|
||||||
comment = null;
|
comment = null;
|
||||||
if (expect(tok!"~") is null) return null;
|
if (expect(tok!"~") is null) return null;
|
||||||
|
node.index = current.index;
|
||||||
|
node.line = current.line;
|
||||||
|
node.column = current.column;
|
||||||
if (expect(tok!"this") is null) return null;
|
if (expect(tok!"this") is null) return null;
|
||||||
if (expect(tok!"(") is null) return null;
|
if (expect(tok!"(") is null) return null;
|
||||||
if (expect(tok!")") is null) return null;
|
if (expect(tok!")") is null) return null;
|
||||||
|
@ -3185,6 +3188,8 @@ interface "Four"
|
||||||
Invariant parseInvariant()
|
Invariant parseInvariant()
|
||||||
{
|
{
|
||||||
auto node = allocate!Invariant;
|
auto node = allocate!Invariant;
|
||||||
|
node.index = current.index;
|
||||||
|
node.line = current.line;
|
||||||
if (expect(tok!"invariant") is null) return null;
|
if (expect(tok!"invariant") is null) return null;
|
||||||
if (currentIs(tok!"("))
|
if (currentIs(tok!"("))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue