aboutsummaryrefslogtreecommitdiffstats
path: root/main/augeas/0009-Shellvars-add-eval-builtin-support.patch
blob: 71f9b73946ef66d1d28bbfcfa27f3ca2455cf7f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From c0ceda2cbc93add3392e87a488947691a886af78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson@camptocamp.com>
Date: Thu, 30 Jul 2015 09:16:12 +0200
Subject: [PATCH 09/19] Shellvars: add eval builtin support

---
 lenses/shellvars.aug            | 6 ++++++
 lenses/tests/test_shellvars.aug | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug
index dc6d4f3..8735d77 100644
--- a/lenses/shellvars.aug
+++ b/lenses/shellvars.aug
@@ -83,6 +83,10 @@ module Shellvars =
 
   let shell_builtin_cmds = "ulimit" | "shift" | "exit"
 
+  let eval =
+    Util.indent . Util.del_str "eval" . Util.del_ws_spc
+    . label "@eval" . store anyquot
+
   let builtin =
     Util.indent . label "@builtin"
     . store shell_builtin_cmds
@@ -169,6 +173,7 @@ module Shellvars =
         | entry_eol_item builtin
         | entry_eol_item return
         | entry_eol_item condition
+        | entry_eol_item eval
 
   let entry_noeol =
     let entry_item (item:lens) = [ item ] in
@@ -179,6 +184,7 @@ module Shellvars =
         | entry_item builtin
         | entry_item return
         | entry_item condition
+        | entry_item eval
 
   let rec rec_entry =
     let entry = comment | entry_eol | rec_entry in
diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug
index 9484754..9d301af 100644
--- a/lenses/tests/test_shellvars.aug
+++ b/lenses/tests/test_shellvars.aug
@@ -580,6 +580,10 @@ esac\n" =
       }
     }
 
+  (* eval *)
+  test lns get "eval `dircolors`\n" =
+    { "@eval" = "`dircolors`" }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)
-- 
2.5.0