- Timestamp:
- 11/26/2007 07:01:44 PM (19 years ago)
- revision id:
- svn-v3-trunk0:2948df59-2b31-0410-8e06-c40c0b09d5b6:trunk:32
- Location:
- trunk
- Files:
-
- 2 edited
-
csv.lisp (modified) (1 diff)
-
matching.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/csv.lisp
r27 r30 1 1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp -*- 2 3 #| 4 Copyright (C) 2007 David Owen <dsowen@fugue88.ws> 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License as published by the Free Software Foundation; either 9 version 2.1 of the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 |# 2 20 3 21 (require '#:dso-lex) -
trunk/matching.lisp
r25 r30 235 235 (destructuring-bind (head . tail) rule 236 236 (if (symbolp head) 237 (symcase head 238 (^ (destructuring-bind (regex) tail 239 `(if-matches-regex ,input ,regex (,next ,match) 240 ,then ,else))) 241 (/ `(if-matches-choice ,input ,tail (,next ,match) ,then ,else)) 242 ({} (destructuring-bind (mincount maxcount subrule) tail 243 `(if-matches-count ,input ,mincount ,maxcount ,subrule 244 (,next ,match) ,then ,else))) 245 (* (destructuring-bind (sub) tail 246 `(if-matches-count ,input 0 nil ,sub (,next ,match) 247 ,then ,else))) 248 (? (destructuring-bind (sub) tail 249 `(if-matches-count ,input 0 1 ,sub (,next ,match) 250 ,then ,else))) 251 (+ (destructuring-bind (sub) tail 252 `(if-matches-count ,input 1 nil ,sub (,next ,match) 253 ,then ,else))) 254 (& (destructuring-bind (sub) tail 255 `(if-matches-required ,input ,sub (,next ,match) 256 ,then ,else))) 257 (! (destructuring-bind (sub) tail 258 `(if-matches-forbidden ,input ,sub (,next ,match) 259 ,then ,else))) 260 (= (destructuring-bind (sub) tail 261 `(if-matches-only ,input ,sub (,next ,match) ,then ,else))) 262 (t `(if-matches-sequence ,input ,rule (,next ,match) 263 ,then ,else))) 264 `(if-matches-sequence ,input ,rule (,next ,match) ,then ,else)))))) 237 (symcase head 238 (^ (destructuring-bind (regex) tail 239 `(if-matches-regex ,input ,regex (,next ,match) 240 ,then ,else))) 241 (/ `(if-matches-choice ,input ,tail (,next ,match) 242 ,then 243 ,else)) 244 ({} (destructuring-bind (mincount maxcount subrule) tail 245 `(if-matches-count ,input ,mincount ,maxcount ,subrule 246 (,next ,match) ,then ,else))) 247 (* (destructuring-bind (sub) tail 248 `(if-matches-count ,input 0 nil ,sub (,next ,match) 249 ,then ,else))) 250 (? (destructuring-bind (sub) tail 251 `(if-matches-count ,input 0 1 ,sub (,next ,match) 252 ,then ,else))) 253 (+ (destructuring-bind (sub) tail 254 `(if-matches-count ,input 1 nil ,sub (,next ,match) 255 ,then ,else))) 256 (& (destructuring-bind (sub) tail 257 `(if-matches-required ,input ,sub (,next ,match) 258 ,then ,else))) 259 (! (destructuring-bind (sub) tail 260 `(if-matches-forbidden ,input ,sub (,next ,match) 261 ,then ,else))) 262 (= (destructuring-bind (sub) tail 263 `(if-matches-only ,input ,sub (,next ,match) 264 ,then 265 ,else))) 266 (t `(if-matches-sequence ,input ,rule (,next ,match) 267 ,then ,else))) 268 `(if-matches-sequence ,input ,rule (,next ,match) ,then ,else))))))
Note: See TracChangeset
for help on using the changeset viewer.
