class Prism::Pattern::CompilationError
当传递给模式的查询是无效的 Ruby 语法,或使用了我们尚未支持的语法时,会抛出此异常。
公共类方法
new(repr) 点击切换源代码
创建一个新的 CompilationError
,其中包含导致错误的节点的给定表示形式。
调用超类方法
# File prism/pattern.rb, line 43 def initialize(repr) super(<<~ERROR) prism was unable to compile the pattern you provided into a usable expression. It failed on to understand the node represented by: #{repr} Note that not all syntax supported by Ruby's pattern matching syntax is also supported by prism's patterns. If you're using some syntax that you believe should be supported, please open an issue on GitHub at https://github.com/ruby/prism/issues/new. ERROR end