File 2d12670-inputrc-else.patch of Package augeas.6793

From 2d12670d15cacb279ec4045acbd296b02ce49be9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cedric.bosdonnat@free.fr>
Date: Tue, 8 Mar 2016 11:07:21 +0100
Subject: [PATCH] inputrc lens: support @else

@if structures can also have an @else, let's read them into another
subtree.
---
 lenses/inputrc.aug            | 2 ++
 lenses/tests/test_inputrc.aug | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lenses/inputrc.aug b/lenses/inputrc.aug
index 15bf96e..3902528 100644
--- a/lenses/inputrc.aug
+++ b/lenses/inputrc.aug
@@ -45,6 +45,8 @@ let variable = [ Util.del_str "set" . Sep.space
 let rec condition = [ Util.del_str "$if" . label "@if"
                     . Sep.space . store Rx.space_in . Util.eol
                     . (Util.empty | Util.comment | condition | variable | entry)*
+                    . [ Util.del_str "$else" . label "@else" . Util.eol
+                      . (Util.empty | Util.comment | condition | variable | entry)* ] ?
                     . Util.del_str "$endif" . Util.eol ]
 
 (* View: lns
diff --git a/lenses/tests/test_inputrc.aug b/lenses/tests/test_inputrc.aug
index ff475f2..1535697 100644
--- a/lenses/tests/test_inputrc.aug
+++ b/lenses/tests/test_inputrc.aug
@@ -61,6 +61,7 @@ $if term=rxvt
 \"\\e[8~\": end-of-line
 \"\\eOc\": forward-word
 \"\\eOd\": backward-word
+$else
 \"\\e[G\": \",\"
 $endif
 
@@ -158,8 +159,10 @@ test Inputrc.lns get conf =
       { "entry" = "\\eOd"
         { "mapping" = "backward-word" }
       }
-      { "entry" = "\\e[G"
-        { "mapping" = "\",\"" }
+      { "@else"
+        { "entry" = "\\e[G"
+          { "mapping" = "\",\"" }
+        }
       }
     }
     {  }
-- 
2.6.6

openSUSE Build Service is sponsored by