tridactyl/compiler/metadata/SymbolMetadata.ts
glacambre 4d0f7c84eb
Make the generated metadata typed
This commit makes the compiler pass use different classes in order to
represent the metadata. This enables adding per-class toString/convert
functions. This enables easy type checking and conversion in the `:set`
excmd.
2018-11-04 17:24:16 +01:00

11 lines
279 B
TypeScript

import { Type } from "../types/AllTypes"
export class SymbolMetadata {
constructor(public doc: string, public type: Type) {}
toConstructor() {
return `new SymbolMetadata(${JSON.stringify(
this.doc,
)}, ${this.type.toConstructor()})`
}
}