Sha256: a8b374a21583ad5cd74ba82f6c8d6bffb8e4a5abe2b41778b26eea309f3e21d8

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
  module Lexers
    load_lexer 'python.rb'
    
    class Mojo < Python
      title "Mojo"
      desc "The Mojo programming language (modular.com)"
      tag 'mojo'
      aliases 'mojo'
      filenames '*.mojo', '*.🔥'
      mimetypes 'text/x-mojo', 'application/x-mojo'

      def self.detect?(text)
        return true if text.shebang?(/mojow?(?:[23](?:\.\d+)?)?/)
      end

      def self.keywords
        @keywords ||= super + %w(
          fn self alias inout borrowed owned ref var
          struct trait raises with in match case
        )
      end

      def self.builtins
        @builtins ||= super + %w(
          __mlir_attr __mlir_type __mlir_op parameter alwaysinline
          register_passable
        )
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rouge-4.5.1 lib/rouge/lexers/mojo.rb
rouge-4.5.0 lib/rouge/lexers/mojo.rb
rouge-4.4.0 lib/rouge/lexers/mojo.rb