aboutsummaryrefslogtreecommitdiff
path: root/stage1
diff options
context:
space:
mode:
Diffstat (limited to 'stage1')
-rw-r--r--stage1/cbt.scala3
1 files changed, 3 insertions, 0 deletions
diff --git a/stage1/cbt.scala b/stage1/cbt.scala
index 5f8f2b5..b97ad44 100644
--- a/stage1/cbt.scala
+++ b/stage1/cbt.scala
@@ -20,6 +20,9 @@ object `package`{
private val lib = new BaseLib
+ implicit class CbtBooleanExtensions(condition: Boolean){
+ def option[T](value: =>T): Option[T] = if(condition) Some(value) else None
+ }
implicit class CbtStringExtensions(string: String){
def escape = string.replace("\\","\\\\").replace("\"","\\\"")
def quote = s""""$escape""""