class Rouge::Lexers::Rust

Public Class Methods

builtins() click to toggle source
# File lib/rouge/lexers/rust.rb, line 34
def self.builtins
  @builtins ||= Set.new %w(
    Add BitAnd BitOr BitXor bool c_char c_double c_float char
    c_int clock_t c_long c_longlong Cons Const Copy c_schar c_short
    c_uchar c_uint c_ulong c_ulonglong c_ushort c_void dev_t DIR
    dirent Div Either Eq Err f32 f64 Failure FILE float fpos_t
    i16 i32 i64 i8 isize Index ino_t int intptr_t Left mode_t Modulo Mul
    Neg Nil None Num off_t Ok Option Ord Owned pid_t Ptr ptrdiff_t
    Right Send Shl Shr size_t Some ssize_t str Sub Success time_t
    u16 u32 u64 u8 usize uint uintptr_t
    Box Vec String Gc Rc Arc
    u128 i128 Result Sync Pin Unpin Sized Drop drop Fn FnMut FnOnce
    Clone PartialEq PartialOrd AsMut AsRef From Into Default
    DoubleEndedIterator ExactSizeIterator Extend IntoIterator Iterator
  )
end
detect?(text) click to toggle source
# File lib/rouge/lexers/rust.rb, line 18
def self.detect?(text)
  return true if text.shebang? 'rustc'
end
keywords() click to toggle source
# File lib/rouge/lexers/rust.rb, line 22
def self.keywords
  @keywords ||= %w(
    as async await break const continue crate dyn else enum extern false
    fn for if impl in let log loop match mod move mut pub ref return self
    Self static struct super trait true type unsafe use where while
    abstract become box do final macro
    override priv typeof unsized virtual
    yield try
    union
  )
end

Public Instance Methods

macro_closed?() click to toggle source
# File lib/rouge/lexers/rust.rb, line 51
def macro_closed?
  @macro_delims.values.all?(&:zero?)
end