rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/lexers/twig.rb

41 lines
1.1 KiB
Ruby
Raw Normal View History

2019-10-21 08:18:17 +00:00
# -*- 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 verbatim endverbatim)
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