From e76e93d23089c47f643f256607f11fb8129e0084 Mon Sep 17 00:00:00 2001 From: yuyi Date: Mon, 6 Feb 2023 22:39:03 +0800 Subject: [PATCH] ast: add comments for ast.AssertStmt and ast.IfGuardExpr (#17235) --- vlib/v/ast/ast.v | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vlib/v/ast/ast.v b/vlib/v/ast/ast.v index 90c93c49eb..45586b783e 100644 --- a/vlib/v/ast/ast.v +++ b/vlib/v/ast/ast.v @@ -1534,14 +1534,15 @@ pub const ( } ) +// `assert a == 0, 'a is zero'` [minify] pub struct AssertStmt { pub: pos token.Pos extra_pos token.Pos pub mut: - expr Expr - extra Expr + expr Expr // `a == 0` + extra Expr // `'a is zero'` is_used bool // asserts are used in _test.v files, as well as in non -prod builds of all files } @@ -1557,8 +1558,8 @@ pub struct IfGuardExpr { pub: vars []IfGuardVar pub mut: - expr Expr - expr_type Type + expr Expr // `opt()` + expr_type Type // type of `opt()` } pub enum OrKind {