vdoc: don't highlight less than expression as generic function (#13938)
parent
f6b8e1e13f
commit
7d8db1042d
|
@ -326,8 +326,8 @@ fn html_highlight(code string, tb &ast.Table) string {
|
||||||
tok_typ = .builtin
|
tok_typ = .builtin
|
||||||
} else if next_tok.kind == .lcbr {
|
} else if next_tok.kind == .lcbr {
|
||||||
tok_typ = .symbol
|
tok_typ = .symbol
|
||||||
} else if next_tok.kind == .lpar
|
} else if next_tok.kind == .lpar || (!tok.lit[0].is_capital()
|
||||||
|| (!tok.lit[0].is_capital() && next_tok.kind == .lt) {
|
&& next_tok.kind == .lt && next_tok.pos == tok.pos + tok.lit.len) {
|
||||||
tok_typ = .function
|
tok_typ = .function
|
||||||
} else {
|
} else {
|
||||||
tok_typ = .name
|
tok_typ = .name
|
||||||
|
|
|
@ -211,7 +211,8 @@ fn color_highlight(code string, tb &ast.Table) string {
|
||||||
&& prev.kind in [.name, .amp, .rsbr, .key_type, .assign, .dot, .question, .rpar, .key_struct, .key_enum, .pipe, .key_interface]
|
&& prev.kind in [.name, .amp, .rsbr, .key_type, .assign, .dot, .question, .rpar, .key_struct, .key_enum, .pipe, .key_interface]
|
||||||
&& (tok.lit[0].is_capital() || prev_prev.lit in ['C', 'JS']) {
|
&& (tok.lit[0].is_capital() || prev_prev.lit in ['C', 'JS']) {
|
||||||
tok_typ = .symbol
|
tok_typ = .symbol
|
||||||
} else if next_tok.kind in [.lpar, .lt] {
|
} else if next_tok.kind == .lpar || (!tok.lit[0].is_capital()
|
||||||
|
&& next_tok.kind == .lt && next_tok.pos == tok.pos + tok.lit.len) {
|
||||||
tok_typ = .function
|
tok_typ = .function
|
||||||
} else if next_tok.kind == .dot {
|
} else if next_tok.kind == .dot {
|
||||||
if tok.lit in ['C', 'JS'] {
|
if tok.lit in ['C', 'JS'] {
|
||||||
|
|
Loading…
Reference in New Issue