summaryrefslogtreecommitdiff
path: root/src/test.el
diff options
context:
space:
mode:
Diffstat (limited to 'src/test.el')
-rw-r--r--src/test.el28
1 files changed, 28 insertions, 0 deletions
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")