Sha256: dc094a8df7f46bd9ae295cdc99b49249fe7d79ecdcdb64e8751d37303c908dfd

Contents?: true

Size: 1.04 KB

Versions: 9

Compression:

Stored size: 1.04 KB

Contents

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

module Rouge
  module Lexers
    load_lexer 'jinja.rb'

    class Twig < Jinja
      title "Twig"
      desc "Twig template engine (twig.sensiolabs.org)"

      tag "twig"

      filenames '*.twig'

      mimetypes 'application/x-twig', 'text/html+twig'

      def self.keywords
        @keywords ||= %w(as do extends flush from import include use else starts
                         ends with without autoescape endautoescape block
                         endblock embed endembed filter endfilter for endfor
                         if endif macro endmacro sandbox endsandbox set endset
                         spaceless endspaceless)
      end

      def self.tests
        @tests ||= %w(constant defined divisibleby empty even iterable null odd
                      sameas)
      end

      def self.pseudo_keywords
        @pseudo_keywords ||= %w(true false none)
      end

      def self.word_operators
        @word_operators ||= %w(b-and b-or b-xor is in and or not)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rouge-4.5.1 lib/rouge/lexers/twig.rb
rouge-4.5.0 lib/rouge/lexers/twig.rb
rouge-4.4.0 lib/rouge/lexers/twig.rb
rouge-4.3.0 lib/rouge/lexers/twig.rb
rouge-4.2.1 lib/rouge/lexers/twig.rb
rouge-4.2.0 lib/rouge/lexers/twig.rb
rouge-4.1.3 lib/rouge/lexers/twig.rb
rouge-4.1.2 lib/rouge/lexers/twig.rb
rouge-4.1.1 lib/rouge/lexers/twig.rb