Files
lib_ruby_parser
bytes
containers
error
diagnostic
level
message
lexer
loc
nodes
node_enum
types
alias
and
and_asgn
arg
args
array
array_pattern
array_pattern_with_tail
back_ref
begin
block
block_pass
blockarg
break_
c_send
case
case_match
casgn
cbase
class
complex
const_
const_pattern
cvar
cvasgn
def
defined
defs
dstr
dsym
e_flip_flop
empty_else
encoding
ensure
erange
false_
file
find_pattern
float
for_
forward_arg
forwarded_args
gvar
gvasgn
hash
hash_pattern
heredoc
i_flip_flop
if_
if_guard
if_mod
if_ternary
in_pattern
index
index_asgn
int
irange
ivar
ivasgn
kw_begin
kwarg
kwargs
kwnilarg
kwoptarg
kwrestarg
kwsplat
lambda
line
lvar
lvasgn
masgn
match_alt
match_as
match_current_line
match_nil_pattern
match_pattern
match_pattern_p
match_rest
match_var
match_with_lvasgn
mlhs
module
next
nil
nth_ref
numblock
op_asgn
optarg
or
or_asgn
pair
pin
postexe
preexe
procarg0
rational
redo
reg_opt
regexp
rescue
rescue_body
restarg
retry
return_
s_class
self_
send
shadowarg
splat
str_
super_
sym
true_
undef
unless_guard
until
until_post
when
while_
while_post
x_heredoc
xstr
yield_
z_super
parser_options
parser_result
reserved_words
source
comment
comment_type
decoded_input
decoder
decoder_result
input_error
magic_comment
magic_comment_kind
maybe_decoder
maybe_token_rewriter
source_line
token_rewriter
token
traverse
>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
use crate::source::token_rewriter::TokenRewriter;
/// Trait with common MaybeTokenRewriter APIs
pub trait MaybeTokenRewriterAPI {
/// Constructs `Some` variant
fn new_some(token_rewriter: TokenRewriter) -> Self
where
Self: Sized;
/// Constructs `None` variant
fn new_none() -> Self
where
Self: Sized;
/// Returns true if `self` is `Some`
fn is_some(&self) -> bool;
/// Returns true if `self` is `None`
fn is_none(&self) -> bool;
/// Casts &self to Option<&TokenRewriter>
fn as_token_rewriter(&self) -> Option<&TokenRewriter>;
/// Casts &mut self to Option<&mut TokenRewriter>
fn as_token_rewriter_mut(&mut self) -> Option<&mut TokenRewriter>;
/// Casts self to TokenRewriter. Panics if self is `None`
fn into_token_rewriter(self) -> TokenRewriter;
}