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

parser: handle operator methods and fix them in vdoc

This commit is contained in:
Alexander Medvednikov
2020-03-10 14:40:30 +01:00
parent 7036ca55e6
commit 2f0bb11a96
3 changed files with 32 additions and 3 deletions

View File

@@ -99,6 +99,10 @@ fn (p mut Parser) fn_decl() ast.FnDecl {
// TODO high
name = p.check_name()
}
if p.tok.kind in [.plus, .minus, .mul, .div, .mod] {
name = p.tok.kind.str() // op_to_fn_name()
p.next()
}
// <T>
if p.tok.kind == .lt {
p.next()