This lexes with the Ripper
lex. It drops any space events but otherwise returns the same tokens. Raises SyntaxError
if the syntax in source is invalid.
SyntaxSuggest.handle_error
[Public]
Takes a ‘SyntaxError` exception, uses the error message to locate the file. Then the file will be analyzed to find the location of the syntax error and emit that location to stderr.
Example:
begin require 'bad_file' rescue => e SyntaxSuggest.handle_error(e) end
By default it will re-raise the exception unless ‘re_raise: false`. The message output location can be configured using the `io: $stderr` input.
If a valid filename cannot be determined, the original exception will be re-raised (even with ‘re_raise: false`).
A block’s parameters.
-> { _1 + _2 } ^^^^^^^^^^^^^^
Compile a GlobalVariableOperatorWriteNode
node
Compile a LocalVariableOperatorWriteNode
node
$foo += bar
becomes
$foo = $foo + bar
Dispatch enter and leave events for GlobalVariableOperatorWriteNode
nodes and continue walking the tree.
Dispatch enter and leave events for LocalVariableOperatorWriteNode
nodes and continue walking the tree.
Inspect a GlobalVariableOperatorWriteNode
node.