Skip to content

Commit

Permalink
Match module with end in block matcher plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Pangoraw committed Nov 13, 2023
1 parent 794a5f4 commit 9ac9c88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/components/CellInput/block_matcher_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@ function match_block(node) {
return match_try_node(node)
}

if (node.name === "module" || node.name === "baremodule") {
let possibly_end = node.parent.lastChild
let did_match = possibly_end.name === "end"
if (!did_match) return null

return [
{ from: node.from, to: node.to },
{ from: possibly_end.from, to: possibly_end.to },
]
}

return null
}
Expand Down

0 comments on commit 9ac9c88

Please sign in to comment.