parser: fix a small bug with <

pull/4967/head
Alexander Medvednikov 2020-05-20 21:47:03 +02:00
parent 82cedbaf62
commit ca81442fac
3 changed files with 6 additions and 6 deletions

View File

@ -803,8 +803,8 @@ pub fn (mut p Parser) name_expr() ast.Expr {
}
// p.warn('name expr $p.tok.lit $p.peek_tok.str()')
// fn call or type cast
if p.peek_tok.kind == .lpar || (p.peek_tok.kind == .lt && p.peek_tok.pos == p.peek_tok2.pos -
1) { // foo() or foo<int>()
if p.peek_tok.kind == .lpar || (p.peek_tok.kind == .lt && p.peek_tok2.kind == .name &&
p.peek_tok.pos == p.peek_tok2.pos - 1) { // foo() or foo<int>()
mut name := p.tok.lit
if mod.len > 0 {
name = '${mod}.$name'