From 9a317e56f8a6126583f7d0c431bf878d9b1fe7b1 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sat, 8 Jul 2023 12:30:21 +0800 Subject: Finished the Emacs binding. Now the binding part is finished. What remains is a bug encountered when planting a fragment to the forest which intersects a packed node, which would lead to invalid forests. This will also cause problem when planting a packed fragment, but until now my testing grammars do not produce packed fragments, so this problem is not encountered yet. I am still figuring out efficient ways to solve this problem. --- src/test.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test.el (limited to 'src/test.el') diff --git a/src/test.el b/src/test.el new file mode 100644 index 0000000..d106a03 --- /dev/null +++ b/src/test.el @@ -0,0 +1,28 @@ +(load-file "rep.so") +(setq rep-dir (vc-call-backend 'Git 'root default-directory)) + +(setq test-parser + (rep-new-parser + (with-temp-buffer + (insert-file-contents + (expand-file-name + "test.abnf" + (expand-file-name + "abnf grammars" + (expand-file-name "grammar" rep-dir)))) + (buffer-string)))) + +(defvar input nil "A vector that represents a testing input.") + +(setq input (vector 3 0 2 2 2 1 1 1 0 1)) + +(rep-recognize test-parser input) +(rep-parse test-parser input) + +;; (rep-parse-string +;; test-parser +;; "* title\nprice: 512\nnote: this is a test\n") + +;; (rep-parse-string +;; test-parser +;; "183t3ru") -- cgit v1.2.3-18-g5258