add SourceInitialiser support

This commit is contained in:
Dave Holoway
2020-06-08 13:53:24 +01:00
parent 3a85c6f819
commit c09620c481
4 changed files with 44 additions and 6 deletions

View File

@@ -504,6 +504,15 @@ class InitialiserBlock extends DeclarationBlock {
constructor(section, simplified, match) {
super(section, simplified);
}
/**
* Returns the TextBlock associated with the method body
*/
body() {
// always the last block atm
const blocks = this.blockArray();
return blocks.blocks[blocks.blocks.length - 1];
}
}
class TypeDeclBlock extends DeclarationBlock {
@@ -601,6 +610,11 @@ class TypeDeclBlock extends DeclarationBlock {
return this.parsed.constructors;
}
get initialisers() {
this._ensureParsed();
return this.parsed.initialisers;
}
get types() {
this._ensureParsed();
return this.parsed.types;