src/final.lisp: Add a new function for testing property-set parsing.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 6 Jul 2018 23:06:53 +0000 (00:06 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 9 Jul 2018 11:02:05 +0000 (12:02 +0100)
doc/SYMBOLS
doc/misc.tex
src/final.lisp

index dbb5d88..44d2040 100644 (file)
@@ -461,6 +461,7 @@ final.lisp
   exercise                                      function
   test-module                                   function
   test-parse-c-type                             function
+  test-parse-pset                               function
   test-parser                                   macro
 
 fragment-parse.lisp
index 7de8a23..8f9a69c 100644 (file)
@@ -593,6 +593,11 @@ These symbols are defined in the @|optparse| package.
       @> t @<c-type> @<kernel> @<string> @! nil @<indicator>}
 \end{describe}
 
+\begin{describe}{fun}
+    {test-parse-pset @<string>
+      @> t @<pset> @! nil @<indicator>}
+\end{describe}
+
 \begin{describe}{mac}
     {test-parser (@<scanner> \&key :backtrace) @<parser> @<input>
       @> @<result> @<status> @<remainder>}
index 0b7a366..93fafe8 100644 (file)
                  (princ-to-string (car value)))
          (values nil value)))))
 
+(export 'test-parse-pset)
+(defun test-parse-pset (string)
+  "Parse STRING as a property set, and show the results."
+  (with-test-scanner (scanner string)
+    (multiple-value-bind (value winp consumedp)
+       (parse-property-set scanner)
+      (declare (ignore consumedp))
+      (values winp value))))
+
 (export 'test-parser)
 (defmacro test-parser ((scanner &key backtrace) parser input)
   "Convenient macro for testing parsers at the REPL.