Coverage report: /home/jsnell/.sbcl/site/cl-ppcre-1.2.13/specials.lisp
Kind | Covered | All | % |
expression | 10 | 16 | 62.5 |
branch | 0 | 0 | nil |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-PPCRE; Base: 10 -*-
2
;;; $Header: /usr/local/cvsrep/cl-ppcre/specials.lisp,v 1.21 2005/04/01 21:29:10 edi Exp $
4
;;; globally declared special variables
6
;;; Copyright (c) 2002-2005, Dr. Edmund Weitz. All rights reserved.
8
;;; Redistribution and use in source and binary forms, with or without
9
;;; modification, are permitted provided that the following conditions
12
;;; * Redistributions of source code must retain the above copyright
13
;;; notice, this list of conditions and the following disclaimer.
15
;;; * Redistributions in binary form must reproduce the above
16
;;; copyright notice, this list of conditions and the following
17
;;; disclaimer in the documentation and/or other materials
18
;;; provided with the distribution.
20
;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
21
;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
24
;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26
;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
;;; special variables used to effect declarations
36
(defvar *standard-optimize-settings*
43
#+:lispworks (hcl:fixnum-safety 0))
44
"The standard optimize settings used by most declaration expressions.")
46
(defvar *special-optimize-settings*
47
'(optimize speed space)
48
"Special optimize settings used only be a few declaration expressions.")
50
;;; special variables used by the lexer/parser combo
52
(defvar *extended-mode-p* nil
53
"Whether the parser will start in extended mode.")
54
(declaim (type boolean *extended-mode-p*))
56
;;; special variables used by the SCAN function and the matchers
59
"The string which is currently scanned by SCAN.
60
Will always be coerced to a SIMPLE-STRING.")
61
(declaim (type simple-string *string*))
64
"Where to start scanning within *STRING*.")
65
(declaim (type fixnum *start-pos*))
67
(defvar *real-start-pos* nil
68
"The real start of *STRING*. This is for repeated scans and is only used internally.")
69
(declaim (type (or null fixnum) *real-start-pos*))
72
"Where to stop scanning within *STRING*.")
73
(declaim (type fixnum *end-pos*))
75
(defvar *reg-starts* (make-array 0)
76
"An array which holds the start positions
77
of the current register candidates.")
78
(declaim (type simple-vector *reg-starts*))
80
(defvar *regs-maybe-start* (make-array 0)
81
"An array which holds the next start positions
82
of the current register candidates.")
83
(declaim (type simple-vector *regs-maybe-start*))
85
(defvar *reg-ends* (make-array 0)
86
"An array which holds the end positions
87
of the current register candidates.")
88
(declaim (type simple-vector *reg-ends*))
90
(defvar *end-string-pos* nil
91
"Start of the next possible end-string candidate.")
94
"Counts the number of \"complicated\" repetitions while the matchers
96
(declaim (type fixnum *rep-num*))
98
(defvar *zero-length-num* 0
99
"Counts the number of repetitions the inner regexes of which may
100
have zero-length while the matchers are built.")
101
(declaim (type fixnum *zero-length-num*))
103
(defvar *repeat-counters* (make-array 0
105
:element-type 'fixnum)
106
"An array to keep track of how often
107
repetitive patterns have been tested already.")
108
(declaim (type (array fixnum (*)) *repeat-counters*))
110
(defvar *last-pos-stores* (make-array 0)
111
"An array to keep track of the last positions
112
where we saw repetitive patterns.
113
Only used for patterns which might have zero length.")
114
(declaim (type simple-vector *last-pos-stores*))
116
(defvar *use-bmh-matchers* t
117
"Whether the scanners created by CREATE-SCANNER should use the \(fast
118
but large) Boyer-Moore-Horspool matchers.")
120
(defvar *allow-quoting* nil
121
"Whether the parser should support Perl's \\Q and \\E.")
123
(pushnew :cl-ppcre *features*)
125
;; stuff for Nikodemus Siivola's HYPERDOC
126
;; see <http://common-lisp.net/project/hyperdoc/>
127
;; and <http://www.cliki.net/hyperdoc>
129
(defvar *hyperdoc-base-uri* "http://weitz.de/cl-ppcre/")
131
(let ((exported-symbols-alist
132
(loop for symbol being the external-symbols of :cl-ppcre
136
(string-downcase symbol))))))
137
(defun hyperdoc-lookup (symbol type)
138
(declare (ignore type))
140
exported-symbols-alist