File: pass_array.aug

package info (click to toggle)
augeas 0.10.0-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 10,308 kB
  • sloc: ansic: 64,277; sh: 13,243; yacc: 528; makefile: 378; lex: 210; perl: 42; pascal: 27
file content (17 lines) | stat: -rw-r--r-- 679 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(* Check that we properly discard skeletons when we shift subtrees   *)
(* across lenses. The test shifts a subtree parsed with SND to one   *)
(* that is put with FST. Since the two have different skeleton types *)
(* we need to ignore the skeleton that comes with it.                *)
module Pass_array =

  let array = 
    let array_value = store /[a-z0-9]+/ in
    let fst = seq "values" . array_value . del /[ \t]+/ "\t" in
    let snd = seq "values" . array_value in
    del "(" "(" . counter "values" .
    [ fst ] * . [ snd ] . del ")" ")"

  let lns = [ key /[a-z]+/ . del "=" "=" . array ]

  test lns put "var=(v1 v2)" after
    set "var/3" "v3" = "var=(v1 v2\tv3)"