From 2a05b4db8ae322fea6a3961e0666df36c5be08c1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 2 Jan 2016 14:39:23 +0100 Subject: [PATCH 1/1] "fix" the official Rust highlighter by monkey-patching --- personal/_plugins/rouge-rust.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 personal/_plugins/rouge-rust.rb diff --git a/personal/_plugins/rouge-rust.rb b/personal/_plugins/rouge-rust.rb new file mode 100644 index 0000000..4a97330 --- /dev/null +++ b/personal/_plugins/rouge-rust.rb @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- # +require 'rouge' + +module Rouge + module Lexers + class Rust + + 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 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 isize uint uintptr_t + Box Vec String Gc Rc Arc + ) + end + + end + end +end -- 2.30.2