This file is indexed.

/usr/share/doc/libparse-recdescent-perl/examples/demo_selfmod.pl is in libparse-recdescent-perl 1.967009+dfsg-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
#!/usr/bin/perl -sw

# A SELF-MODIFYING**2 PARSER

use Parse::RecDescent;

$grammar =
q{
	type_defn : 'only' <commit> "$::keyword" is type_name ';'
		       { $thisparser->Replace("type_name: '$item[5]'");
			  print "\"$item[5]\" is now the only valid type name\n";
		       }

		  | "$::keyword" <commit> identifier(s) is type_name /('?s)?/ ';'
		       { my $newnames = join " | ", map { "'$_'" } @{$item[3]};
			  $thisparser->Extend("type_name: $newnames");
			  print "added $newnames as type name(s)\n";
		       }

		  | /change\s+$::keyword\s+to/ identifier
		       { $::keyword = $item[2];
			  print "changed $item[0] keyword to: $item[2]\n";
		       }

		  | <error>

	is        : /is|are/

	type_name : 'int' | 'float'

	identifier: ...!is ...!"$::keyword" ...!type_name /[A-Za-z]\w*/

};

use vars qw { $keyword };

$keyword = "type";

$parse = new Parse::RecDescent ($grammar);

while (<>)
{
	$parse->type_defn($_) or print "huh?\n";
}