Skip to content

Commit

Permalink
fix scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
meevee98 committed Dec 22, 2019
1 parent c82a9f2 commit d1c5355
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/kotlin/br/com/pnp/semantic/PnpContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ class PnpContext(val analyser: Analyser) : PnpBaseListener() {
} ?: throw UnknownSemanticException(ctx.start)
}

override fun exitWhileBlock(ctx: PnpParser.WhileBlockContext) {
analyser.endScope()
}

// endregion

// region type validation
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/br/com/pnp/compiler/wat/WatCompilerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class WatCompilerTest : AppTest() {

val expectedResult = """
(module
(func (export "main")
(func (export "main") (local ${dollar}test1 i32)
i32.const 1
block ${dollar}B0
get_local ${dollar}test1
Expand Down

0 comments on commit d1c5355

Please sign in to comment.