Signed-off-by: Jean Privat <jean@pryen.org>
var readme = dirpath2.join_path("README.md")
if not readme.file_exists then readme = dirpath2.join_path("README")
if readme.file_exists then
- var mdoc = new MDoc
+ var mdoc = new MDoc(new Location(new SourceFile.from_string(readme, ""),0,0,0,0))
var s = new FileReader.open(readme)
while not s.eof do
mdoc.content.add(s.read_line)
module mdoc
import model_base
+import location
# Structured documentation of a `MEntity` object
class MDoc
# The entity where the documentation is originally attached to.
# This gives some context to resolve identifiers or to run examples.
var original_mentity: nullable MEntity = null is writable
+
+ # The original location of the doc for error messages
+ var location: Location
end
redef class MEntity
do
var res = mdoc_cache
if res != null then return res
- res = new MDoc
+ res = new MDoc(location)
for c in n_comment do
var text = c.text
if text.length < 2 then