From a20bef65ba0352050c91492a4e9d44d52d796cee Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 25 Apr 2020 17:34:42 +0300 Subject: [PATCH] fmt: workaround a vfmt limitation preventing formatting of vlib/v/ast/ast.v --- vlib/v/ast/ast.v | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/vlib/v/ast/ast.v b/vlib/v/ast/ast.v index d17fbdeb51..319d107402 100644 --- a/vlib/v/ast/ast.v +++ b/vlib/v/ast/ast.v @@ -428,14 +428,9 @@ pub: is_else bool } -pub struct CompIf { -pub: - val string - stmts []Stmt - is_not bool - pos token.Position -mut: + /* +CompIf.is_opt: `$if xyz? {}` => this compile time `if` is optional, and .is_opt reflects the presence of ? at the end. When .is_opt is true, the code should compile, even @@ -443,6 +438,14 @@ if `xyz` is NOT defined. If .is_opt is false, then when `xyz` is not defined, the compilation will fail. */ + +pub struct CompIf { +pub: + val string + stmts []Stmt + is_not bool + pos token.Position +mut: is_opt bool has_else bool else_stmts []Stmt