This represents an error that was encountered during parsing.
This is a result specific to the ‘parse` and `parse_file` methods.
A pattern is an object that wraps a Ruby pattern matching expression. The expression would normally be passed to an ‘in` clause within a `case` expression or a rightward assignment expression. For example, in the following snippet:
case node in ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]] end
the pattern is the ConstantPathNode[...]
expression.
The pattern gets compiled into an object that responds to call by running the compile
method. This method itself will run back through Prism
to parse the expression into a tree, then walk the tree to generate the necessary callable objects. For example, if you wanted to compile the expression above into a callable, you would:
callable = Prism::Pattern.new("ConstantPathNode[ConstantReadNode[name: :Prism], ConstantReadNode[name: :Pattern]]").compile callable.call(node)
The callable object returned by compile
is guaranteed to respond to call with a single argument, which is the node to match against. It also is guaranteed to respond to ===
, which means it itself can be used in a ‘case` expression, as in:
case node when callable end
If the query given to the initializer cannot be compiled into a valid matcher (either because of a syntax error or because it is using syntax we do not yet support) then a Prism::Pattern::CompilationError
will be raised.
The error type thrown by all PStore
methods.
Indicates a failure to resolve a name or address.
Installs a gem along with all its dependencies from local and remote gems.
Raised when trying to activate a gem, and that gem does not exist on the system. Instead of rescuing from this class, make sure to rescue from the superclass Gem::LoadError
to catch all types of load errors.
Raised when there are conflicting gem specs loaded
Raised by Gem::Resolver
when a Gem::Dependency::Conflict reaches the toplevel. Indicates which dependencies were incompatible through conflict
and conflicting_dependencies
Raised when attempting to uninstall a gem that isn’t in GEM_HOME.
Raised when removing a gem with the uninstall command fails
Raised by the DependencyInstaller when a specific gem cannot be found
Raised by Gem::Resolver
when dependencies conflict and create the inability to find a valid possible spec for a request.
Signals that a remote operation cannot be conducted, probably due to not being connected (or just not finding host).
Raised when a gem dependencies file specifies a ruby version that does not match the current version.
Raised by Resolver when a dependency requests a gem for which there is no spec.