Codegen: Fix return type of getResolveStep and resolve

This commit is contained in:
Tom Hvitved
2024-09-16 14:19:29 +02:00
parent 2cafa3c228
commit 8d68bdf4d6
5 changed files with 388 additions and 382 deletions

View File

@@ -9,7 +9,9 @@ private import {{import_prefix}}.Raw
{{#imports}}
import {{.}}
{{/imports}}
{{#root}}
private class {{name}}Alias = {{name}};
{{/root}}
/**
* INTERNAL: This module contains the fully generated definition of `{{name}}` and should not
* be referenced directly.
@@ -49,13 +51,13 @@ module Generated {
* Classes can override this to indicate this node should be in the "hidden" AST, mostly reserved
* for conversions and syntactic sugar nodes like parentheses.
*/
{{name}} getResolveStep() { none() } // overridden by subclasses
{{name}}Alias getResolveStep() { none() } // overridden by subclasses
/**
* Gets the element that should substitute this element in the explicit AST, applying `getResolveStep`
* transitively.
*/
final {{name}} resolve() {
final {{name}}Alias resolve() {
not exists(this.getResolveStep()) and result = this
or
result = this.getResolveStep().resolve()