mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00

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.
11 lines
279 B
TypeScript
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()})`
|
|
}
|
|
}
|