1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: minor cleanup in parse_type.v (#14863)

This commit is contained in:
yuyi 2022-06-28 02:33:18 +08:00 committed by GitHub
parent 2d40ba1f49
commit 044698746e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,8 +150,7 @@ pub fn (mut p Parser) parse_map_type() ast.Type {
} }
pub fn (mut p Parser) parse_chan_type() ast.Type { pub fn (mut p Parser) parse_chan_type() ast.Type {
if p.peek_tok.kind != .name && p.peek_tok.kind != .key_mut && p.peek_tok.kind != .amp if p.peek_tok.kind !in [.name, .key_mut, .amp, .lsbr] {
&& p.peek_tok.kind != .lsbr {
p.next() p.next()
return ast.chan_type return ast.chan_type
} }
@ -171,8 +170,7 @@ pub fn (mut p Parser) parse_thread_type() ast.Type {
if is_opt { if is_opt {
p.next() p.next()
} }
if p.peek_tok.kind != .name && p.peek_tok.kind != .key_mut && p.peek_tok.kind != .amp if p.peek_tok.kind !in [.name, .key_mut, .amp, .lsbr] {
&& p.peek_tok.kind != .lsbr {
p.next() p.next()
if is_opt { if is_opt {
mut ret_type := ast.void_type mut ret_type := ast.void_type