summaryrefslogtreecommitdiff
path: root/src/test.el
blob: d106a03bb61954f5ea002f0a91d109015807a900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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")