Skip to content

Commit 91df23f

Browse files
authored
Merge pull request #4244 from mame/pattern-module-name
Compare the Pattern DSL prefix with the module name
2 parents a0fe15e + e365778 commit 91df23f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/prism/pattern.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def compile_alternation_pattern_node(node) # :nodoc:
175175
def compile_constant_path_node(node) # :nodoc:
176176
parent = node.parent
177177

178-
if parent.is_a?(ConstantReadNode) && parent.slice == "Prism"
178+
if (parent.is_a?(ConstantReadNode) || parent.is_a?(ConstantPathNode)) && parent.slice == Prism.name
179179
name = node.name
180180
raise CompilationError, node.inspect if name.nil?
181181

0 commit comments

Comments
 (0)