class Rouge::Lexers::Hack

Public Class Methods

detect?(text) click to toggle source
# File lib/rouge/lexers/hack.rb, line 14
def self.detect?(text)
  return true if /<\?hh/ =~ text
  return true if text.shebang?('hhvm')
  return true if /async function [a-zA-Z]/ =~ text
  return true if /\): Awaitable</ =~ text

  return false
end
keywords() click to toggle source
Calls superclass method
# File lib/rouge/lexers/hack.rb, line 23
def self.keywords
  @hh_keywords ||= super.merge Set.new %w(
    type newtype enum
    as super
    async await Awaitable
    vec dict keyset
    void int string bool float double
    arraykey num Stringish
  )
end