let process x =
let rec rest i =
if i < len then match x.[i] with
| '$' -> var (i+1)
| c
-> Buffer.add_char r c
; rest
(i
+1) and var i =
if i < len then match x.[i] with
| 'a'..'z' | 'A'..'Z' -> var (i+1)
| _ -> rest i in
rest 0;
bGV0IHByb2Nlc3MgeCA9IAogICAgbGV0IGxlbiA9IFN0cmluZy5sZW5ndGggeCBpbiAKICAgIGxldCByID0gQnVmZmVyLmNyZWF0ZSAxMDAgaW4gCiAgICBsZXQgcmVjIHJlc3QgaSA9IAogICAgICAgIGlmIGkgPCBsZW4gdGhlbiBtYXRjaCB4LltpXSB3aXRoIAogICAgICAgICAgICB8ICckJyAtPiB2YXIgKGkrMSkgCiAgICAgICAgICAgIHwgYyAtPiBCdWZmZXIuYWRkX2NoYXIgciBjOyByZXN0IChpKzEpIAogICAgYW5kIHZhciBpID0gCiAgICAgICAgaWYgaSA8IGxlbiB0aGVuIG1hdGNoIHguW2ldIHdpdGggCiAgICAgICAgICAgIHwgJ2EnLi4neicgfCAnQScuLidaJyAtPiB2YXIgKGkrMSkgCiAgICAgICAgICAgIHwgXyAtPiByZXN0IGkgaW4gCiAgICByZXN0IDA7IAogICAgQnVmZmVyLmNvbnRlbnRzIHIK