vdoc: fix compilation

pull/5965/head
Delyan Angelov 2020-07-24 12:30:38 +03:00
parent 8c4429c875
commit 2cf8a53eac
1 changed files with 4 additions and 4 deletions

View File

@ -285,7 +285,7 @@ fn html_highlight(code string, tb &table.Table) string {
} else { tok.lit }
return if typ in [.unone, .name] { lit } else { '<span class="token $typ">$lit</span>' }
}
s := scanner.new_scanner(code, .parse_comments, &pref.Preferences{})
mut s := scanner.new_scanner(code, .parse_comments, &pref.Preferences{})
mut tok := s.scan()
mut next_tok := s.scan()
mut buf := strings.new_builder(200)
@ -388,7 +388,7 @@ fn (cfg DocConfig) readme_idx() int {
return -1
}
fn write_toc(cn doc.DocNode, nodes []doc.DocNode, toc &strings.Builder) {
fn write_toc(cn doc.DocNode, nodes []doc.DocNode, mut toc strings.Builder) {
toc_slug := if cn.content.len == 0 { '' } else { slug(cn.name) }
toc.write('<li class="open"><a href="#$toc_slug">${cn.name}</a>')
children := nodes.find_children_of(cn.name)
@ -403,7 +403,7 @@ fn write_toc(cn doc.DocNode, nodes []doc.DocNode, toc &strings.Builder) {
toc.writeln('</li>')
}
fn (cfg DocConfig) write_content(cn &doc.DocNode, dcs &doc.Doc, hw &strings.Builder) {
fn (cfg DocConfig) write_content(cn &doc.DocNode, dcs &doc.Doc, mut hw strings.Builder) {
base_dir := os.base_dir(os.real_path(cfg.input_path))
file_path_name := if cfg.is_multi { cn.file_path.replace('$base_dir/', '') } else { os.file_name(cn.file_path) }
src_link := get_src_link(cfg.manifest.repo_url, file_path_name, cn.pos.line)
@ -429,7 +429,7 @@ fn (cfg DocConfig) gen_html(idx int) string {
for cn in dcs.contents {
cfg.write_content(&cn, &dcs, &contents)
if cn.attrs['parent'] == 'Constants' || cn.attrs['category'] == 'Methods' { continue }
write_toc(cn, dcs.contents, &toc)
write_toc(cn, dcs.contents, mut toc)
} // write head
// get resources
doc_css := cfg.get_resource(css_js_assets[0], true)