Introduce typed semantic analysis pipeline
This commit is contained in:
parent
117d188194
commit
f4cd4f4458
30 changed files with 2079 additions and 2381 deletions
|
|
@ -104,14 +104,14 @@ func (g *goGenerator) emitCoroutineSupport() {
|
|||
func (g *goGenerator) coroutineLambda(lambda LambdaExpr, returnType string) (string, error) {
|
||||
var b strings.Builder
|
||||
b.WriteString("func(gotlinScope *GotlinCoroutineScope)")
|
||||
if mapped := mapGoType(returnType); mapped != "" {
|
||||
if mapped := g.goType(returnType); mapped != "" {
|
||||
b.WriteString(" ")
|
||||
b.WriteString(mapped)
|
||||
}
|
||||
b.WriteString(" {\n")
|
||||
sub := goGenerator{indentLevel: 1, needsFmt: g.needsFmt, needsTime: g.needsTime, needsCoroutines: true, functions: g.functions, classes: g.classes, workers: g.workers, enums: g.enums, imports: g.imports, currentFunc: FunctionDecl{ReturnType: returnType}, currentClass: g.currentClass, currentWorker: g.currentWorker, currentCoroutineScope: "gotlinScope", mappings: g.mappings}
|
||||
sub := goGenerator{semantic: g.semantic, indentLevel: 1, needsFmt: g.needsFmt, needsTime: g.needsTime, needsCoroutines: true, currentFunc: FunctionDecl{ReturnType: returnType}, currentClass: g.currentClass, currentCoroutineScope: "gotlinScope"}
|
||||
sub.scopes = g.cloneScopes()
|
||||
sub.typeScopes = g.cloneTypeScopes()
|
||||
sub.semanticScope = g.semanticScope
|
||||
sub.pushScope()
|
||||
if err := sub.block(lambda.Body); err != nil {
|
||||
return "", err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue