examples: fix left/right arrows in examples/term.ui/text_editor.v

pull/8975/head
Delyan Angelov 2021-02-25 21:01:27 +02:00
parent c7587c0760
commit 639061be6c
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 2 additions and 3 deletions

View File

@ -155,8 +155,6 @@ pub enum Modifiers {
alt alt
} }
[inline] pub fn (m &Modifiers) is_empty() bool { return int(m) == 0 }
pub struct Event { pub struct Event {
pub: pub:
typ EventType typ EventType

View File

@ -2204,6 +2204,7 @@ fn (mut p Parser) enum_decl() ast.EnumDecl {
pubfn := if p.mod == 'main' { 'fn' } else { 'pub fn' } pubfn := if p.mod == 'main' { 'fn' } else { 'pub fn' }
p.scanner.codegen(' p.scanner.codegen('
// //
[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 ( 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) 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) clear(flag $enum_name) { unsafe{ *e = ${enum_name}(int(*e) & ~(int(flag))) } }