From 2480cce1edc95f643a90adcf6df735f33dbf44b0 Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Wed, 8 Jul 2020 01:36:48 +1000 Subject: [PATCH] checker: optimize if & fix typo --- vlib/v/checker/checker.v | 2 +- vlib/v/parser/pratt.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index e7477e94ac..0e1f2fe38d 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -1025,7 +1025,7 @@ pub fn (mut c Checker) call_fn(mut call_expr ast.CallExpr) table.Type { found = true } // try prefix with current module as it would have never gotten prefixed - if !fn_name.contains('.') && call_expr.mod !in ['builtin'] { + else if !fn_name.contains('.') && call_expr.mod !in ['builtin'] { name_prefixed := '${call_expr.mod}.$fn_name' if f1 := c.table.find_fn(name_prefixed) { call_expr.name = name_prefixed diff --git a/vlib/v/parser/pratt.v b/vlib/v/parser/pratt.v index b4bb18028d..a6f1516e28 100644 --- a/vlib/v/parser/pratt.v +++ b/vlib/v/parser/pratt.v @@ -168,7 +168,7 @@ pub fn (mut p Parser) expr(precedence int) ast.Expr { node = p.anon_fn() // its a call // NOTE: this could be moved to just before the pratt loop - // then anything can be a call, eg. `index[2]()` or `stuct.field()` + // then anything can be a call, eg. `index[2]()` or `struct.field()` // but this would take a bit of modification if p.tok.kind == .lpar { p.next()