mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
match: this needs a 2 step PR
This commit is contained in:
parent
9743b04fe6
commit
d8edc27805
@ -151,8 +151,8 @@ fn generate_vh(mod string) {
|
||||
continue
|
||||
}
|
||||
match tok.tok {
|
||||
TokenKind.key_fn { generate_fn(out, p.tokens, i) }
|
||||
TokenKind.key_const { generate_const(out, p.tokens, i) }
|
||||
TokenKind.key_fn => { generate_fn(out, p.tokens, i) }
|
||||
TokenKind.key_const => { generate_const(out, p.tokens, i) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -816,9 +816,9 @@ fn (p mut Parser) struct_decl() {
|
||||
p.check(.colon)
|
||||
mut val := ''
|
||||
match p.tok {
|
||||
.name { val = p.check_name() }
|
||||
.str { val = p.check_string() }
|
||||
else {
|
||||
.name => { val = p.check_name() }
|
||||
.str => { val = p.check_string() }
|
||||
else => {
|
||||
p.error('attribute value should be either name or string')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user