chiark / gitweb /
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 dbb5d887136e50465808d9fc22e59202e1a23b72..44d2040997dd9cb7e34e19479e0eff9d77ee1e48 100644 (file)
@@ -461,6 +461,7 @@ final.lisp
   exercise                                      function
   test-module                                   function
   test-parse-c-type                             function
   exercise                                      function
   test-module                                   function
   test-parse-c-type                             function
+  test-parse-pset                               function
   test-parser                                   macro
 
 fragment-parse.lisp
   test-parser                                   macro
 
 fragment-parse.lisp
index 7de8a23690b4ecaec924476c3f644400795177b3..8f9a69c646e9969e32fdd4b29c45c54994ec0382 100644 (file)
@@ -593,6 +593,11 @@ These symbols are defined in the @|optparse| package.
       @> t @<c-type> @<kernel> @<string> @! nil @<indicator>}
 \end{describe}
 
       @> 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>}
 \begin{describe}{mac}
     {test-parser (@<scanner> \&key :backtrace) @<parser> @<input>
       @> @<result> @<status> @<remainder>}
index 0b7a36617cce33be0088ff981e191b8049f30c0c..93fafe86e65ef3a738bdc4df222bb763e036013e 100644 (file)
@@ -93,6 +93,15 @@ (defun test-parse-c-type (string)
                  (princ-to-string (car value)))
          (values nil value)))))
 
                  (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.
 (export 'test-parser)
 (defmacro test-parser ((scanner &key backtrace) parser input)
   "Convenient macro for testing parsers at the REPL.