Emit.is_safe.plain: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/emit.bend as Emit Lines 115-122 of yaml-for-bend@0.1.1.0/emit.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/emit.bend&start_line=115&end_line=122 import Base import yaml-for-bend@0.1.1.0/core.bend as C # Whether +s+ reads back as itself when written plain: it isn't empty, has # no blank at either end, starts with no indicator, holds no ": ", " #" or # character that needs escaping, and the Core schema reads it as a string. def is_safe.plain(+s: String) -> Bool: Bool.and(Bool.and(Bool.not(String.is_empty(s)), all.plain(s)), Bool.and(Bool.and(Bool.not(is_in(first.char(s), " -?:,[]{}#&*!|>'\"%@`")), Bool.not(Char.is_eq(last.char(s), ' '))), Bool.and(Bool.and(Bool.not(String.contains(s, ": ")), Bool.not(String.contains(s, " #"))), Bool.and(Bool.not(String.ends_with(s, ":")), is_str(C.plain(s)))))) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.contains https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.ends_with https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/core.bend&name=plain https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/emit.bend&name=all.plain https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/emit.bend&name=first.char https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/emit.bend&name=is_in https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/emit.bend&name=is_str https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/emit.bend&name=last.char