class Rouge::Lexers::Moonscript

Public Class Methods

analyze_text(text) click to toggle source
# File lib/rouge/lexers/moonscript.rb, line 24
def self.analyze_text(text)
  return 1 if text.shebang? 'moon'
end
new(*) click to toggle source
Calls superclass method
# File lib/rouge/lexers/moonscript.rb, line 17
def initialize(*)
  super

  @function_highlighting = bool_option(:function_highlighting) { true }
  @disabled_modules = list_option(:disabled_modules)
end

Public Instance Methods

builtins() click to toggle source
# File lib/rouge/lexers/moonscript.rb, line 28
def builtins
  return [] unless @function_highlighting

  @builtins ||= Set.new.tap do |builtins|
    Rouge::Lexers::Lua.builtins.each do |mod, fns|
      next if @disabled_modules.include? mod
      builtins.merge(fns)
    end
  end
end