match: this needs a 2 step PR

pull/2504/head
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')
}
}