Rosetta Code/Fix code tags: Difference between revisions

Undo revision 266616 by Dijkstra Incorrectly marked incorrect. There IS no language named "barf" so those tags were not changed.
(Found incorrectness.)
(Undo revision 266616 by Dijkstra Incorrectly marked incorrect. There IS no language named "barf" so those tags were not changed.)
Line 82:
 
=={{header|Erlang}}==
{{incorrect|Erlang|<%s> .. <\%s> tag pairs are not converted e.g. "<barf>".}}
Commented away are 3 lines that would create a dict of the existing languages on Rosetta Code. Since the examples have 3 imaginary code tags, I replaced that code this way.
<lang Erlang>#! /usr/bin/env escript
#! /usr/bin/env escript
-module( fix_code_tags ).
-mode( compile ).
Line 121:
 
loop( eof, Acc ) -> lists:reverse( Acc );
loop( Line, Acc ) -> loop( io:get_line(""), [Line | Acc] ).</lang>
}</lang>
{{out}}
<pre>% cat fix_code_tags
% cat fix_code_tags
Lorem ipsum <code foo>saepe audire</code> elaboraret ne quo, id equidem
atomorum inciderint usu. <foo>In sit inermis deleniti percipit</foo>,
Line 136 ⟶ 138:
altera electram. Tota adhuc altera te sea, <lang bar>soluta appetere ut mel</lang>.
Quo quis graecis vivendo te, <lang baz>posse nullam lobortis ex usu</lang>. Eam volumus perpetua
constituto id, mea an omittam fierent vituperatoribus.</pre>
</pre>
 
=={{header|F_Sharp|F#}}==
Line 269 ⟶ 272:
 
=={{header|J}}==
{{incorrect|J|<%s> .. <\%s> tag pairs are not converted e.g. "<barf>".}}
'''Solution:'''
<lang j>require 'printf strings files'
Line 306 ⟶ 308:
 
=={{header|Java}}==
{{incorrect|Java|<%s> .. <\%s> tag pairs are not converted e.g. "<barf>".}}
<lang java>import java.io.BufferedReader;
import java.io.File;
Line 373 ⟶ 374:
}
}
}
}</lang>
</lang>
 
Example:
<pre>
<pre>user@ubuntu:~$ cat fix.in
Lorem ipsum <code foo>saepe audire</code> elaboraret ne quo, id equidem
atomorum inciderint usu. <foo>In sit inermis deleniti percipit</foo>,
Line 390 ⟶ 394:
altera electram. Tota adhuc altera te sea, <lang bar>soluta appetere ut mel</bar>.
Quo quis graecis vivendo te, <baz>posse nullam lobortis ex usu</lang>. Eam volumus perpetua
constituto id, mea an omittam fierent vituperatoribus.</pre>
 
</pre>
 
=={{header|JavaScript}}==
Line 802 ⟶ 808:
 
=={{header|Ruby}}==
{{incorrect|Ruby|<%s> .. <\%s> tag pairs are not converted e.g. "<barf>".}}
<lang ruby># get all stdin in one string
#text = $stdin.read
Line 823 ⟶ 828:
altera electram. Tota adhuc altera te sea, <code bar>soluta appetere ut mel</bar>.
Quo quis graecis vivendo te, <baz>posse nullam lobortis ex usu</code>. Eam volumus perpetua
constituto id, mea an omittam fierent vituperatoribus. </lang>
 
<pre>Lorem ipsum <lang foo>saepe audire</lang> elaboraret ne quo, id equidem
10,333

edits