nitc :: DocUnit :: real_location
ast
based on mdoc.location
The result is basically: ast_location + markdown location of the piece + mdoc.location
The fun is that a single docunit can be made of various pieces of code blocks.
# Compute the real location of a node on the `ast` based on `mdoc.location`
#
# The result is basically: ast_location + markdown location of the piece + mdoc.location
#
# The fun is that a single docunit can be made of various pieces of code blocks.
fun real_location(ast_location: Location): Location
do
var mdoc = self.mdoc
var res = new Location(mdoc.location.file,
lines[ast_location.line_start-1],
lines[ast_location.line_end-1],
columns[ast_location.line_start-1] + ast_location.column_start,
columns[ast_location.line_end-1] + ast_location.column_end)
return res
end
src/testing/testing_doc.nit:521,2--537,4