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

doc: update match syntax

This commit is contained in:
Alexander Medvednikov 2020-06-21 20:02:35 +02:00 committed by GitHub
parent 81c19517d1
commit 9c6b772395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1151,7 +1151,7 @@ struct CallExpr {
... ...
} }
fn (p mut Parser) expr(precedence int) Expr { fn (mut p Parser) expr(precedence int) Expr {
match p.tok { match p.tok {
.key_if { return IfExpr{} } .key_if { return IfExpr{} }
... ...
@ -1161,7 +1161,7 @@ fn (p mut Parser) expr(precedence int) Expr {
fn gen(expr Expr) { fn gen(expr Expr) {
match expr { match expr {
IfExpr { gen_if(it) } IfExpr { gen_if(expr) } // `expr` is cast to the matched type automatically
... ...
} }
} }