From 91a2c90f46c9f9b27735fe305fbeb640a29e3143 Mon Sep 17 00:00:00 2001 From: zkim Date: Thu, 23 Dec 2010 16:55:40 -0700 Subject: [PATCH] Added an example from fnparse to the problem-cases section. --- src/problem_cases/general.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/problem_cases/general.clj b/src/problem_cases/general.clj index afe7d56..a6bc9b4 100644 --- a/src/problem_cases/general.clj +++ b/src/problem_cases/general.clj @@ -32,3 +32,20 @@ "This is also a docstring via metadata. It should be on the left."} c "This is just a value. It should be on the right.") + +;; From [fnparse](https://github.com/joshua-choi/fnparse) + +; Define single-character indicator rules. +; I use `clojure.template/do-template` to reduce repetition. +(do-template [rule-name token] + (h/defrule rule-name + "Padded on the front with optional whitespace." + (h/lit token)) + \\ + \" + \, + \: + \[ + \] + \{ + \}) \ No newline at end of file