Exception: Prism::Pattern::CompilationError
- Inherits:
-
StandardError
- Object
- StandardError
- Prism::Pattern::CompilationError
- Defined in:
- lib/prism/pattern.rb,
sig/generated/prism/pattern.rbs
Overview
Raised when the query given to a pattern is either invalid Ruby syntax or is using syntax that we don't yet support.
Instance Method Summary collapse
-
#initialize(repr) ⇒ CompilationError
constructor
Create a new CompilationError with the given representation of the node that caused the error.
Constructor Details
#initialize(repr) ⇒ CompilationError
Create a new CompilationError with the given representation of the node that caused the error.
: (String repr) -> void
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/prism/pattern.rb', line 48 def initialize(repr) # :nodoc: 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 |