1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: unwrap long infix exprs inside parenthesis if necessary (#8609)

This commit is contained in:
Lukas Neubert
2021-02-07 23:10:39 +01:00
committed by GitHub
parent ff1aa06455
commit 7f4c582f1a
18 changed files with 93 additions and 52 deletions

View File

@ -310,7 +310,7 @@ fn (vd VDoc) gen_html(d doc.Doc) string {
} else {
symbols_toc_str
}).replace('{{ contents }}', contents.str()).replace('{{ right_content }}', if cfg.is_multi
&& vd.docs.len > 1&& d.head.name != 'README' {
&& vd.docs.len > 1 && d.head.name != 'README' {
'<div class="doc-toc"><ul>' + symbols_toc_str + '</ul></div>'
} else {
''
@ -401,7 +401,7 @@ fn html_highlight(code string, tb &table.Table) string {
if token.is_key(tok.lit) || token.is_decl(tok.kind) {
tok_typ = .keyword
} else if tok.kind == .decl_assign || tok.kind.is_assign() || tok.is_unary()
|| tok.kind.is_relational()|| tok.kind.is_infix() {
|| tok.kind.is_relational() || tok.kind.is_infix() {
tok_typ = .operator
}
}