nitc :: Prod :: collect_comments
TComment
contained in the production(between start_token
and end_token
).
# Collect all `TComment` contained in the production
# (between `start_token` and `end_token`).
private fun collect_comments: Array[TComment] do
var res = new Array[TComment]
if start_token == null or last_token == null then return res
var token = start_token
while token != last_token do
if token isa TComment then res.add token
token = token.next_token
end
return res
end
src/pretty.nit:376,2--389,4