Occasionally it’s helpful to treat a string as if it were interpolated so that there’s a consistent interface for working with strings.
Occasionally it’s helpful to treat a string as if it were interpolated so that there’s a consistent interface for working with strings.
Return the byte offset of the start of the line corresponding to the given byte offset.
Returns the byte offset of the end of the line corresponding to the given byte offset.
These are the comments that are associated with this location that exist before the start of this location.
Attach a comment to the leading comments of this location.
These are the comments that are associated with this location that exist after the end of this location.
Attach a comment to the trailing comments of this location.
Returns all of the lines of the source code associated with this location.
The source code that this location represents starting from the beginning of the line that this location starts on to the end of the line that this location ends on.
The line number where this location starts.
The line number where this location ends.
Implement the pretty print interface for Location
.
Returns a string representation of the syntax tree with the errors displayed inline.
Implement the pretty print interface for Token
.
Shortcut for combining two procs into one that returns true if both return true.
Shortcut for combining two procs into one that returns true if either returns true.
Used by the Resolver, the protocol to use a AvailableSet
as a search Set
.
Call the given block when invoked.
Normal command invocations just executes the execute
method of the command. Specifying an invocation block allows the test methods to override the normal action of a command to determine that it has been invoked correctly.
Register the Symbol
command
as a gem command.
Unregister the Symbol
command
as a gem command.
Return a sorted list of all command names as strings.
Does this dependency match spec
?
NOTE: This is not a convenience method. Unlike match?
this method returns true when spec
is a prerelease version even if this dependency is not a prerelease dependency.