Strip block comments: Difference between revisions

PascalABC.NET
m (syntax highlighting fixup automation)
(PascalABC.NET)
 
(2 intermediate revisions by 2 users not shown)
Line 851:
function something() {
}</pre>
 
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
subr process
i = 1
while i <= len s$
if inc = 0 and substr s$ i 2 = "/*"
inc = 1
i += 1
elif inc = 1 and substr s$ i 2 = "*/"
inc = 0
i += 1
elif inc = 0
write substr s$ i 1
.
i += 1
.
if inc = 0
print ""
.
.
repeat
s$ = input
until error = 1
process
.
input_data
/**
* Some comments
* longer comments here that we can parse.
*
* Rahoo
*/
function subroutine() {
a = /* inline comment */ b + c ;
}
/*/ <-- tricky comments */
 
/**
* Another comment.
*/
function something() {
}
</syntaxhighlight>
 
 
=={{header|F_Sharp|F#}}==
Line 1,890 ⟶ 1,935:
function something() {
}</pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
begin
var s := '''
/**
* Some comments
* longer comments here that we can parse.
*
* Rahoo
*/
function subroutine() {
a = /* inline comment */ b + c ;
}
/*/ <-- tricky comments */
/**
* Another comment.
*/
function something() {
}
''';
Regex.Replace(s,'/\*(\n|\r|\r\n|.)*?\*/','').Print
end.
</syntaxhighlight>
{{out}}
<pre>
 
function subroutine() {
a = b + c ;
}
function something() {
}
</pre>
 
 
=={{header|Perl}}==
Line 3,106 ⟶ 3,189:
=={{header|Wren}}==
{{trans|Go}}
<syntaxhighlight lang="ecmascriptwren">var stripper = Fn.new { |start, end|
if (start == "" || end == "") {
start = "/*"
230

edits