onelang
Version:
OneLang transpiler framework core
15 lines (14 loc) • 627 B
TypeScript
import { OneAst as one } from "../Ast";
import { AstTransformer } from "../AstTransformer";
/**
* After parsing an input source code file, it is not known that a "T" is
* an unknown type called "T" or it is a generic type, as it only turns
* out when a class or method is flagged with <T> in its declaration.
*
* So this tranform modifies "T" from (unknown) type "T" to generic type "T"
* in classes "ExampleClass<T> { ... T ... }"
* and methods "ExampleMethod<T>(...) { ... T ... }"
*/
export declare class FixGenericAndEnumTypes extends AstTransformer<void> {
protected visitType(type: one.Type): void;
}