MCPcopy Create free account
hub / github.com/compilets/compilets / addDeclaration

Method addDeclaration

src/cpp-file.ts:56–62  ·  view source on GitHub ↗

* Add a top-level class/function declaration.

(declaration: syntax.DeclarationStatement)

Source from the content-addressed store, hash-verified

54 * Add a top-level class/function declaration.
55 */
56 addDeclaration(declaration: syntax.DeclarationStatement) {
57 // When seeing class/function declaration in main script, the variable
58 // statements before should be treated as static variables.
59 if (this.type != 'lib')
60 this.pushVariableStatementsToDeclarations();
61 this.pushDeclaration(declaration);
62 }
63
64 /**
65 * Add a top-level variable declaration.

Callers 2

parseSourceFileMethod · 0.95
addVariableStatementMethod · 0.95

Calls 2

pushDeclarationMethod · 0.95

Tested by

no test coverage detected