From cba36c9f9e16a405e6e866c7345643ee9d9a5908 Mon Sep 17 00:00:00 2001 From: Fumitoshi Ukai Date: Tue, 7 Jul 2015 16:04:18 +0900 Subject: fix err_unterminated_func.mk --- expr.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'expr.go') diff --git a/expr.go b/expr.go index 5ed645d..9778de4 100644 --- a/expr.go +++ b/expr.go @@ -25,6 +25,7 @@ import ( ) var ( + errEndOfInput = errors.New("unexpected end of input") errNotLiteral = errors.New("valueNum: not literal") ) @@ -392,7 +393,8 @@ Loop: } exp = appendStr(exp, in[b:i], op.alloc) if i == len(in) && term != nil { - return exp, i, fmt.Errorf("parse: unexpected end of input: %q %d [%q]", in, i, term) + logf("parse: unexpected end of input: %q %d [%q]", in, i, term) + return exp, i, errEndOfInput } return compactExpr(exp), i, nil } @@ -612,6 +614,9 @@ func parseFunc(f mkFunc, in []byte, s int, term []byte, funcName string, alloc b } v, n, err := parseExpr(in[i:], term, op) if err != nil { + if err == errEndOfInput { + return nil, 0, fmt.Errorf("*** unterminated call to function `%s': missing `)'.", funcName) + } return nil, 0, err } v = concatLine(v) -- cgit v1.2.3