This repository has been archived by the owner on Dec 29, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tomohiro Matsuyama
committed
Nov 4, 2012
1 parent
9e6f5b6
commit 5401384
Showing
7 changed files
with
130 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(defpackage :optima.contrib | ||
(:use :cl) | ||
(:export #:ppcre)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(in-package :optima.contrib) | ||
|
||
(defmethod optima::parse-constructor-pattern ((name (eql 'ppcre)) &rest args) | ||
(destructuring-bind (re . patterns) args | ||
(optima::make-constructor-pattern | ||
:specifier `(ppcre ,@args) | ||
:signature `(ppcre ,re) | ||
:arguments (mapcar #'optima::parse-pattern patterns) | ||
:predicate (lambda (var) (values `(nth-value 1 (ppcre:scan-to-strings ,re ,var)) t)) | ||
:accessor (lambda (var i) `(svref ,var ,i))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(asdf:defsystem :optima.contrib | ||
:description "Contribution library for optima" | ||
:long-description "Contribution library for optima. | ||
Available Patterns | ||
------------------ | ||
### PPCRE | ||
(ppcre REGEXP PATTERN*) | ||
Matches REGEXP against the target string. Sub-PATTERNs will be used to | ||
match the matched groups, if REGEXP matched. | ||
Examples: | ||
(match \"2012-11-04\" | ||
((ppcre \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\" year month day) | ||
(list year month day))) | ||
=> (\"2012\" \"11\" \"04\")" | ||
:version "0.2" | ||
:author "Tomohiro Matsuyama" | ||
:license "LLGPL" | ||
:depends-on (:optima | ||
:cl-ppcre) | ||
:components ((:module "contrib" | ||
:serial t | ||
:components ((:file "package") | ||
(:file "ppcre"))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(asdf:defsystem :optima.test | ||
:depends-on (:optima :eos) | ||
:depends-on (:eos :optima :optima.contrib) | ||
:components ((:file "test/suite"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters