1
0
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:
Alexander Medvednikov 2019-10-23 01:00:52 +03:00
parent 9743b04fe6
commit d8edc27805
2 changed files with 5 additions and 5 deletions

View File

@ -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) }
}
}
}

View File

@ -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')
}
}