From 8cbfd7a9da40c13908b590c0fe1210cf9fd48c6f Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 27 Sep 2019 05:56:38 +0300 Subject: [PATCH] parser: partial interface fix --- compiler/parser.v | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/parser.v b/compiler/parser.v index 2501acac52..668ca4c0d3 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -183,6 +183,14 @@ fn (p & Parser) peek() Token { return tok.tok } +fn (p &Parser) peek_token() Tok { + if p.token_idx >= p.tokens.len - 2 { + return Tok{tok:Token.eof} + } + tok := p.tokens[p.token_idx] + return tok +} + fn (p &Parser) log(s string) { /* if !p.pref.is_verbose { @@ -516,6 +524,7 @@ fn (p mut Parser) interface_method(field_name, receiver string) &Fn { //p.log('is interface. field=$field_name run=$p.pass') p.fn_args(mut method) if p.scanner.has_gone_over_line_end() { + //if p.prev_tok.line_nr != p.tok.line_nr { method.typ = 'void' } else { method.typ = p.get_type()// method return type