From 639061be6ce13e3ab3fbd1f8c73c284c9c58a90b Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 25 Feb 2021 21:01:27 +0200 Subject: [PATCH] examples: fix left/right arrows in examples/term.ui/text_editor.v --- vlib/term/ui/input.v | 2 -- vlib/v/parser/parser.v | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/vlib/term/ui/input.v b/vlib/term/ui/input.v index 839e67905c..a44b0bc22a 100644 --- a/vlib/term/ui/input.v +++ b/vlib/term/ui/input.v @@ -155,8 +155,6 @@ pub enum Modifiers { alt } -[inline] pub fn (m &Modifiers) is_empty() bool { return int(m) == 0 } - pub struct Event { pub: typ EventType diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 3cd479db7e..bcceb1d039 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -2204,7 +2204,8 @@ fn (mut p Parser) enum_decl() ast.EnumDecl { pubfn := if p.mod == 'main' { 'fn' } else { 'pub fn' } p.scanner.codegen(' // -[inline] $pubfn ( e &$enum_name) has(flag $enum_name) bool { return (int(*e) & (int(flag))) != 0 } +[inline] $pubfn ( e &$enum_name) is_empty() bool { return int(*e) == 0 } +[inline] $pubfn ( e &$enum_name) has(flag $enum_name) bool { return (int(*e) & (int(flag))) != 0 } [inline] $pubfn (mut e $enum_name) set(flag $enum_name) { unsafe{ *e = ${enum_name}(int(*e) | (int(flag))) } } [inline] $pubfn (mut e $enum_name) clear(flag $enum_name) { unsafe{ *e = ${enum_name}(int(*e) & ~(int(flag))) } } [inline] $pubfn (mut e $enum_name) toggle(flag $enum_name) { unsafe{ *e = ${enum_name}(int(*e) ^ (int(flag))) } }