From 2cf8a53eacc251ea653d267f7df5a41bdbb1a52f Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 24 Jul 2020 12:30:38 +0300 Subject: [PATCH] vdoc: fix compilation --- cmd/tools/vdoc.v | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/tools/vdoc.v b/cmd/tools/vdoc.v index d8afc00419..f3fe22c965 100644 --- a/cmd/tools/vdoc.v +++ b/cmd/tools/vdoc.v @@ -285,7 +285,7 @@ fn html_highlight(code string, tb &table.Table) string { } else { tok.lit } return if typ in [.unone, .name] { lit } else { '$lit' } } - 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('
  • ${cn.name}') 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('
  • ') } -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)