Syntax highlighting using Mediawiki formatting: Difference between revisions

Content added Content deleted
m (→‎{{header|Julia}}: more comments)
m (→‎{{header|Julia}}: shorten for)
Line 535: Line 535:
either = Regex("$startcomment|$stopcomment", "sa")
either = Regex("$startcomment|$stopcomment", "sa")
depth, startpos, stoppos = 0, 0, 0
depth, startpos, stoppos = 0, 0, 0
'''for''' (i, m) '''in''' enumerate(eachmatch(either, s))
'''for''' m '''in''' eachmatch(either, s)
'''if''' m.match == startcomment
'''if''' m.match == startcomment
startpos = startpos == 0 ? m.match.offset : startpos
startpos = startpos == 0 ? m.match.offset : startpos