From b43f83b8cd06dfbe0866685b31b6c4db41138776 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 17 Nov 2014 04:31:48 +0100 Subject: mds-kbdc: fix treeisation of if-statements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- test-files/mds-kbdc/make-tree/valid/if-else | 9 +++ test-files/mds-kbdc/make-tree/valid/if-elseif | 9 +++ test-files/mds-kbdc/make-tree/valid/if-elseif-else | 9 +++ .../mds-kbdc/make-tree/valid/if-elseif-elseif | 59 ++++++++++++++++++ .../mds-kbdc/make-tree/valid/if-elseif-elseif-else | 70 ++++++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 test-files/mds-kbdc/make-tree/valid/if-elseif-elseif create mode 100644 test-files/mds-kbdc/make-tree/valid/if-elseif-elseif-else (limited to 'test-files/mds-kbdc/make-tree/valid') diff --git a/test-files/mds-kbdc/make-tree/valid/if-else b/test-files/mds-kbdc/make-tree/valid/if-else index 217f478..796f2bf 100644 --- a/test-files/mds-kbdc/make-tree/valid/if-else +++ b/test-files/mds-kbdc/make-tree/valid/if-else @@ -3,6 +3,7 @@ if \1 else : "\2" end if + : "a" # (if (@ 1 0-2) ‘\1’ # (.inner @@ -26,4 +27,12 @@ end if # ) # ) # ) +# (map (@ 6 0-0) +# (.sequence +# (keys (@ 6 0-10) ‘’) +# ) +# (.result +# (string (@ 6 13-16) ‘"a"’) +# ) +# ) diff --git a/test-files/mds-kbdc/make-tree/valid/if-elseif b/test-files/mds-kbdc/make-tree/valid/if-elseif index 44d8d1f..5a61010 100644 --- a/test-files/mds-kbdc/make-tree/valid/if-elseif +++ b/test-files/mds-kbdc/make-tree/valid/if-elseif @@ -3,6 +3,7 @@ if \1 else if \2 : "\2" end if + : "a" # (if (@ 1 0-2) ‘\1’ # (.inner @@ -31,4 +32,12 @@ end if # ) # ) # ) +# (map (@ 6 0-0) +# (.sequence +# (keys (@ 6 0-10) ‘’) +# ) +# (.result +# (string (@ 6 13-16) ‘"a"’) +# ) +# ) diff --git a/test-files/mds-kbdc/make-tree/valid/if-elseif-else b/test-files/mds-kbdc/make-tree/valid/if-elseif-else index 461ebc7..ece7744 100644 --- a/test-files/mds-kbdc/make-tree/valid/if-elseif-else +++ b/test-files/mds-kbdc/make-tree/valid/if-elseif-else @@ -5,6 +5,7 @@ else if \2 else : "\3" end if + : "a" # (if (@ 1 0-2) ‘\1’ # (.inner @@ -42,4 +43,12 @@ end if # ) # ) # ) +# (map (@ 8 0-0) +# (.sequence +# (keys (@ 8 0-10) ‘’) +# ) +# (.result +# (string (@ 8 13-16) ‘"a"’) +# ) +# ) diff --git a/test-files/mds-kbdc/make-tree/valid/if-elseif-elseif b/test-files/mds-kbdc/make-tree/valid/if-elseif-elseif new file mode 100644 index 0000000..81f59fb --- /dev/null +++ b/test-files/mds-kbdc/make-tree/valid/if-elseif-elseif @@ -0,0 +1,59 @@ +if \1 + : "\1" +else if \2 + : "\2" +else if \3 + : "\3" +end if + : "a" + +# (if (@ 1 0-2) ‘\1’ +# (.inner +# (map (@ 2 2-2) +# (.sequence +# (keys (@ 2 2-13) ‘’) +# ) +# (.result +# (string (@ 2 16-20) ‘"\1"’) +# ) +# ) +# ) +# (.otherwise +# (if (@ 3 3-7) ‘\2’ +# (.inner +# (map (@ 4 4-4) +# (.sequence +# (keys (@ 4 4-15) ‘’) +# ) +# (.result +# (string (@ 4 18-22) ‘"\2"’) +# ) +# ) +# ) +# (.otherwise +# (if (@ 5 3-7) ‘\3’ +# (.inner +# (map (@ 6 4-4) +# (.sequence +# (keys (@ 6 4-15) ‘’) +# ) +# (.result +# (string (@ 6 18-22) ‘"\3"’) +# ) +# ) +# ) +# (.otherwise nil) +# ) +# ) +# ) +# ) +# ) +# (map (@ 8 0-0) +# (.sequence +# (keys (@ 8 0-10) ‘’) +# ) +# (.result +# (string (@ 8 13-16) ‘"a"’) +# ) +# ) + diff --git a/test-files/mds-kbdc/make-tree/valid/if-elseif-elseif-else b/test-files/mds-kbdc/make-tree/valid/if-elseif-elseif-else new file mode 100644 index 0000000..c4bbf5b --- /dev/null +++ b/test-files/mds-kbdc/make-tree/valid/if-elseif-elseif-else @@ -0,0 +1,70 @@ +if \1 + : "\1" +else if \2 + : "\2" +else if \3 + : "\3" +else + : "\4" +end if + : "a" + +# (if (@ 1 0-2) ‘\1’ +# (.inner +# (map (@ 2 2-2) +# (.sequence +# (keys (@ 2 2-13) ‘’) +# ) +# (.result +# (string (@ 2 16-20) ‘"\1"’) +# ) +# ) +# ) +# (.otherwise +# (if (@ 3 3-7) ‘\2’ +# (.inner +# (map (@ 4 4-4) +# (.sequence +# (keys (@ 4 4-15) ‘’) +# ) +# (.result +# (string (@ 4 18-22) ‘"\2"’) +# ) +# ) +# ) +# (.otherwise +# (if (@ 5 3-7) ‘\3’ +# (.inner +# (map (@ 6 4-4) +# (.sequence +# (keys (@ 6 4-15) ‘’) +# ) +# (.result +# (string (@ 6 18-22) ‘"\3"’) +# ) +# ) +# ) +# (.otherwise +# (map (@ 8 4-4) +# (.sequence +# (keys (@ 8 4-15) ‘’) +# ) +# (.result +# (string (@ 8 18-22) ‘"\4"’) +# ) +# ) +# ) +# ) +# ) +# ) +# ) +# ) +# (map (@ 10 0-0) +# (.sequence +# (keys (@ 10 0-10) ‘’) +# ) +# (.result +# (string (@ 10 13-16) ‘"a"’) +# ) +# ) + -- cgit v1.2.3-70-g09d2