parser: partial interface fix

pull/2126/head
Alexander Medvednikov 2019-09-27 05:56:38 +03:00
parent 8f9c0b621e
commit 8cbfd7a9da
1 changed files with 9 additions and 0 deletions

View File

@ -183,6 +183,14 @@ fn (p & Parser) peek() Token {
return tok.tok 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) { fn (p &Parser) log(s string) {
/* /*
if !p.pref.is_verbose { 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.log('is interface. field=$field_name run=$p.pass')
p.fn_args(mut method) p.fn_args(mut method)
if p.scanner.has_gone_over_line_end() { if p.scanner.has_gone_over_line_end() {
//if p.prev_tok.line_nr != p.tok.line_nr {
method.typ = 'void' method.typ = 'void'
} else { } else {
method.typ = p.get_type()// method return type method.typ = p.get_type()// method return type