This file is indexed.

/usr/lib/ruby/vendor_ruby/rugments/lexers/prolog.rb is in ruby-rugments 1.0.0~beta8-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
module Rugments
  module Lexers
    class Prolog < RegexLexer
      title 'Prolog'
      desc 'The Prolog programming language (http://en.wikipedia.org/wiki/Prolog)'
      tag 'prolog'
      aliases 'prolog'
      filenames '*.pro', '*.P', '*.prolog', '*.pl'
      mimetypes 'text/x-prolog'

      def self.analyze_text(text)
        return 0.1 if text =~ /\A\w+(\(\w+\,\s*\w+\))*\./
        return 0.1 if text.include? ':-'
      end

      state :basic do
        rule /\s+/, Text
        rule /^#.*/, Comment::Single
        rule /\/\*/, Comment::Multiline, :nested_comment

        rule /[\[\](){}|.,;!]/, Punctuation
        rule /:-|-->/, Punctuation

        rule /"[^"]*"/, Str::Double

        rule /\d+\.\d+/, Num::Float
        rule /\d+/, Num
      end

      state :atoms do
        rule /[[:lower:]]([_[:lower:][:digit:]])*/, Str::Symbol
        rule /'[^']*'/, Str::Symbol
      end

      state :operators do
        rule /(<|>|=<|>=|==|=:=|=|\/|\/\/|\*|\+|-)(?=\s|[a-zA-Z0-9\[])/,
             Operator
        rule /is/, Operator
        rule /(mod|div|not)/, Operator
        rule /[#&*+-.\/:<=>?@^~]+/, Operator
      end

      state :variables do
        rule /[A-Z]+\w*/, Name::Variable
        rule /_[[:word:]]*/, Name::Variable
      end

      state :root do
        mixin :basic
        mixin :atoms
        mixin :variables
        mixin :operators
      end

      state :nested_comment do
        rule /\/\*/, Comment::Multiline, :push
        rule /\s*\*[^*\/]+/, Comment::Multiline
        rule /\*\//, Comment::Multiline, :pop!
      end
    end
  end
end