]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix comments (and add tests)
authorfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 7 Jul 2019 16:42:24 +0000 (18:42 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Sun, 7 Jul 2019 16:42:24 +0000 (18:42 +0200)
ast
help/lcov.sh [deleted file]
tests/error/malformed_hex_escape.gw [new file with mode: 0644]
tests/error/malformed_octal_escape.gw [new file with mode: 0644]
tests/tree/comment.gw [new file with mode: 0644]
tests/tree/known_escape.gw [new file with mode: 0644]
tests/tree/non_octal_escape.gw [new file with mode: 0644]
tests/tree/wellformed_hex_escape.gw [new file with mode: 0644]
tests/tree/wellformed_octal_escape.gw [new file with mode: 0644]

diff --git a/ast b/ast
index 1b4487bfbb845050d0b5c0ed1a1564c9edf4f7ec..7594db9ff91af21530f6cfc4b4a5c0a583b9adae 160000 (submodule)
--- a/ast
+++ b/ast
@@ -1 +1 @@
-Subproject commit 1b4487bfbb845050d0b5c0ed1a1564c9edf4f7ec
+Subproject commit 7594db9ff91af21530f6cfc4b4a5c0a583b9adae
diff --git a/help/lcov.sh b/help/lcov.sh
deleted file mode 100644 (file)
index 539768c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-
-OUTFILE=lcov/lcov.info
-
-[ -d lcov ] || mkdir lcov
-
-lcov --no-external --capture --directory src --output-file "$OUTFILE"
-
-[ -z "$TRAVIS_BUILD_DIR" ] || {
-  coveralls-lcov lcov/lcov.info
-  exit
-}
-
-genhtml -q -s -t "Gwion: coverage" -o lcov --precision 2 $OUTFILE
-
-keyboard_cb() {
-cat << EOF > lcov/helper_gcov.js
-var i = 1;
-var cusid_ele = document.getElementsByClassName('$1');
-function keyDownTextField(e) {
-var keyCode = e.keyCode;
-  if(keyCode==78) {
-    var item = cusid_ele[i];
-    cusid_ele[i].scrollIntoView();
-    i++;
-  } else if(keyCode==66){
-    i--;
-    var item = cusid_ele[i];
-    cusid_ele[i].scrollIntoView();
-  }
-  if(i < 1) i = 1;
-  var size = cusid_ele.length - 1;
-  if(i > size) i = size;
-}
-document.addEventListener("keydown", keyDownTextField, false);
-EOF
-}
-
-keyboard_cb 'LineNoCov'
-keyboard_cb 'coverFnLo'
-
-for file in lcov/**/*.c.gcov.html
-do sed -i 's/<body>/<body><script src="..\/helper_gcov.js"><\/script>/' "$file"
-done
-
-for file in lcov/**/*.*.func*.html
-do sed -i 's/<body>/<body><script src="..\/helper_func.js"><\/script>/' "$file"
-done
-
diff --git a/tests/error/malformed_hex_escape.gw b/tests/error/malformed_hex_escape.gw
new file mode 100644 (file)
index 0000000..bf6f035
--- /dev/null
@@ -0,0 +1,2 @@
+#! [contains] malformed hex escape sequence
+<<<"\xG">>>;
diff --git a/tests/error/malformed_octal_escape.gw b/tests/error/malformed_octal_escape.gw
new file mode 100644 (file)
index 0000000..0c463b9
--- /dev/null
@@ -0,0 +1,2 @@
+#! [contains] malformed octal escape sequence
+<<<"\038[31mred\033[0m">>>;
diff --git a/tests/tree/comment.gw b/tests/tree/comment.gw
new file mode 100644 (file)
index 0000000..f9cbcf1
--- /dev/null
@@ -0,0 +1 @@
+<<<int #! this a partial comment !# i>>>;
diff --git a/tests/tree/known_escape.gw b/tests/tree/known_escape.gw
new file mode 100644 (file)
index 0000000..8c2196f
--- /dev/null
@@ -0,0 +1 @@
+<<<"\v", "">>>;
diff --git a/tests/tree/non_octal_escape.gw b/tests/tree/non_octal_escape.gw
new file mode 100644 (file)
index 0000000..49e6fb0
--- /dev/null
@@ -0,0 +1 @@
+<<<"\08">>>;
diff --git a/tests/tree/wellformed_hex_escape.gw b/tests/tree/wellformed_hex_escape.gw
new file mode 100644 (file)
index 0000000..87e9fdf
--- /dev/null
@@ -0,0 +1 @@
+<<<"\x002">>>;
diff --git a/tests/tree/wellformed_octal_escape.gw b/tests/tree/wellformed_octal_escape.gw
new file mode 100644 (file)
index 0000000..57e2e7f
--- /dev/null
@@ -0,0 +1 @@
+<<<"\033[31mred\033[0m">>>;