| 1 |
-- main.mcl -- |
| 2 |
# escaping examples |
| 3 |
|
| 4 |
test "A: \${test}" {} |
| 5 |
|
| 6 |
test "B: \$" {} |
| 7 |
|
| 8 |
$c1 = "This is c1" |
| 9 |
test "C: ${c1}" {} |
| 10 |
|
| 11 |
test "D: \\\$" {} |
| 12 |
|
| 13 |
test "E: {}" {} |
| 14 |
|
| 15 |
test "F: hello" {} |
| 16 |
|
| 17 |
$g1 = "This is g1" |
| 18 |
test "G: ${g1} EOF" {} |
| 19 |
|
| 20 |
test "H: {hhh} EOF" {} |
| 21 |
|
| 22 |
$i_i = "This is ii" |
| 23 |
test "I: ${i_i} EOF" {} |
| 24 |
|
| 25 |
# is this okay? |
| 26 |
test "J: $ is a dollar sign" {} |
| 27 |
|
| 28 |
test "K: $ {zzz} EOF" {} |
| 29 |
|
| 30 |
$l1 = "This is l1" |
| 31 |
test "L: $$${l1} EOF" {} |
| 32 |
|
| 33 |
test "M: $ $$" {} |
| 34 |
|
| 35 |
test "N: hello \" world" {} |
| 36 |
|
| 37 |
test "O: hello \"\" world" {} |
| 38 |
|
| 39 |
test "P: hello \\ world" {} |
| 40 |
|
| 41 |
test "Q: hello \\\\ world" {} |
| 42 |
|
| 43 |
$r1 = "This is r1" |
| 44 |
test "R: \\${r1} EOF" {} |
| 45 |
|
| 46 |
test "S: \\$ EOF" {} |
| 47 |
|
| 48 |
test "T: newline\nEOF" {} |
| 49 |
|
| 50 |
test "U: tab\t\\\ttabEOF" {} |
| 51 |
|
| 52 |
# test "V: " {} |
| 53 |
|
| 54 |
test "W: \\$" {} |
| 55 |
|
| 56 |
$x1 = "This is x1" |
| 57 |
test "X: $${x1} EOF" {} |
| 58 |
|
| 59 |
$unused = "i am unused" |
| 60 |
$y1 = "{unused}" |
| 61 |
test "Y: $${y1} EOF" {} # check there isn't double parsing |
| 62 |
|
| 63 |
test "Z: $$$" {} |
| 64 |
-- OUTPUT -- |
| 65 |
Vertex: test[A: ${test}] |
| 66 |
Vertex: test[B: $] |
| 67 |
Vertex: test[C: This is c1] |
| 68 |
Vertex: test[D: \$] |
| 69 |
Vertex: test[E: {}] |
| 70 |
Vertex: test[F: hello] |
| 71 |
Vertex: test[G: This is g1 EOF] |
| 72 |
Vertex: test[H: {hhh} EOF] |
| 73 |
Vertex: test[I: This is ii EOF] |
| 74 |
Vertex: test[J: $ is a dollar sign] |
| 75 |
Vertex: test[K: $ {zzz} EOF] |
| 76 |
Vertex: test[L: $$This is l1 EOF] |
| 77 |
Vertex: test[M: $ $$] |
| 78 |
Vertex: test[N: hello " world] |
| 79 |
Vertex: test[O: hello "" world] |
| 80 |
Vertex: test[P: hello \ world] |
| 81 |
Vertex: test[Q: hello \\ world] |
| 82 |
Vertex: test[R: \This is r1 EOF] |
| 83 |
Vertex: test[S: \$ EOF] |
| 84 |
Vertex: test[T: newline |
| 85 |
EOF] |
| 86 |
Vertex: test[U: tab \ tabEOF] |
| 87 |
Vertex: test[W: \$] |
| 88 |
Vertex: test[X: $This is x1 EOF] |
| 89 |
Vertex: test[Y: ${unused} EOF] |
| 90 |
Vertex: test[Z: $$$] |