Skip to content

Commit

Permalink
Add missing pop_begin/pop_end for mapping types (#1173)
Browse files Browse the repository at this point in the history
I found this additional required fix after merging #1159. This is so
bindings can be processed for files with using directives on mapping
types without crashing. We want to merge this before #1149 to get a
meaningful baseline before those fixes are applied.
  • Loading branch information
ggiraldez authored Dec 2, 2024
1 parent 8cac89b commit c327122
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/solidity/inputs/language/bindings/rules.msgb
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ inherit .lexical_scope
@type_name [TypeName @mapping [MappingType]] {
let @type_name.type_ref = @mapping.lexical_scope
let @type_name.output = @mapping.output
let @type_name.pop_begin = @mapping.pop_begin
let @type_name.pop_end = @mapping.pop_end
}


Expand Down Expand Up @@ -845,6 +847,12 @@ inherit .lexical_scope

; resolve the value type through our scope
edge @value_type.type_ref -> @mapping.lexical_scope

; We use the value_type's definition path as our own because it's needed when
; a mapping is the target of a `using` directive. It's not correct, but we
; don't have the analog referencing path either.
let @mapping.pop_begin = @value_type.pop_begin
let @mapping.pop_end = @value_type.pop_end
}


Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c327122

Please sign in to comment.