RosettaCodeData/Task/Strip-block-comments/Ed/strip-block-comments.ed

20 lines
261 B
Plaintext

# by Artyom Bologov
H
,p
# Join all the lines to make multi-line comments searchable
g/./s/$/|/
,j
# A nice separator
a
----------------------
.
p
d
# Remove blocks comments
# (faulty heuristic, searches for non-/ chars)
g/./s/\/\*[^/]*\*\///g
g/|/s//\
/g
,p
Q