File: pass_array.aug

package info (click to toggle)
augeas 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 8,216 kB
  • ctags: 5,097
  • sloc: ansic: 48,281; sh: 11,387; cpp: 624; yacc: 515; ruby: 444; makefile: 319; lex: 198; perl: 27; 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)"