Task

Find all    <lang>    tags without a language specified in the text of a page.

Display counts by language section:

Description

<lang>Pseudocode</lang>

=={{header|C}}==
<lang C>printf("Hello world!\n");</lang>

=={{header|Perl}}==
<lang>print "Hello world!\n"</lang>

should display something like

2 bare language tags.

1 in perl
1 in no language



Extra credit

Allow multiple files to be read.   Summarize all results by language:

5 bare language tags.

2 in c ([[Foo]], [[Bar]])
1 in perl ([[Foo]])
2 in no language ([[Baz]])



Extra extra credit

Use the   Media Wiki API   to test actual RC tasks.




import Utils		# To get the FindFirst class
 
procedure main()
    keys := ["{{header|","<lang>"]
    lang := "No language"
    tags := table(0)
    total := 0
 
    ff := FindFirst(keys)
    f := reads(&input, -1)
 
    f ? while tab(ff.locate()) do {
        if "{{header|" == 1(ff.getMatch(), ff.moveMatch()) then lang := map(tab(upto("}}")))
        else (tags[lang] +:= 1, total +:= 1)
        }
 
    write(total," bare language tags:\n")
    every pair := !sort(tags) do write(pair[2]," in ",pair[1])
end