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

ast: add comments for ast.AssertStmt and ast.IfGuardExpr (#17235)

This commit is contained in:
yuyi 2023-02-06 22:39:03 +08:00 committed by GitHub
parent 7090e905f7
commit e76e93d230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {