Skip to content

Commit

Permalink
Merge pull request #14 from jbouwman/asdf-ref
Browse files Browse the repository at this point in the history
Drop stray reference to asdf
  • Loading branch information
Jesse Bouwman authored Mar 23, 2024
2 parents c5a44a1 + 195fa72 commit c978112
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 636 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Translate and remove references to asdf
Build scaffold of alt asdf loader
Define archive format

Expand Down
2 changes: 2 additions & 0 deletions epsilon.lisp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(in-package :cl-user)

(require :sb-cltl2)
(require :sb-posix)
(require :sb-bsd-sockets)
(require :sb-rotate-byte)

(defun load-order (entry)
Expand Down
4 changes: 1 addition & 3 deletions src/epsilon.sexp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"uuid"
("type" "macro-utils"
"vectors"
"streams"
("sbcl-opt" "fndb"
"nib-tran"))
"streams")
"list"
"sequence"
"hash"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/regex/convert.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,5 @@ or an EVERYTHING object \(if the regex starts with something like
(coerce (slot-value starts-with 'str)
'simple-string)))
(values converted-parse-tree reg-num starts-with
;; we can't simply use *ALLOW-NAMED-REGISTERS*
;; since parse-tree syntax ignores it
(when named-reg-seen
(nreverse reg-names)))))
19 changes: 4 additions & 15 deletions src/lib/regex/lexer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,7 @@ closing #\> will also be consumed."
((#\B)
:non-word-boundary)
((#\k)
(cond ((and *allow-named-registers*
(looking-at-p lexer #\<))
;; back-referencing a named register
(incf (lexer-pos lexer))
(list :back-reference
(parse-register-name-aux lexer)))
(t
;; false alarm, just unescape \k
#\k)))
#\k)
((#\d #\D #\w #\W #\s #\S)
;; these will be treated like character classes
(map-char-to-special-char-class next-char))
Expand Down Expand Up @@ -622,12 +614,9 @@ closing #\> will also be consumed."
(cond ((and next-char
(alpha-char-p next-char))
;; we have encountered a named group
;; are we supporting register naming?
(unless *allow-named-registers*
(signal-syntax-error* (1- (lexer-pos lexer))
"Character '~A' may not follow '(?<' (because ~a = NIL)"
next-char
'*allow-named-registers*))
(signal-syntax-error* (1- (lexer-pos lexer))
"Character '~A' may not follow '(?<'"
next-char)
;; put the letter back
(decf (lexer-pos lexer))
;; named group
Expand Down
1 change: 0 additions & 1 deletion src/lib/regex/package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#:digit-char-p
#:defconstant)
(:export
#:*allow-named-registers*
#:*allow-quoting*
#:*look-ahead-for-suffix*
#:*optimize-char-classes*
Expand Down
1 change: 0 additions & 1 deletion src/lib/regex/parser.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ The productions are: <group> -> \"\(\"<regex>\")\"
\"\(?<!\"<regex>\")\"
\"\(?\(\"<num>\")\"<regex>\")\"
\"\(?\(\"<regex>\")\"<regex>\")\"
\"\(?<name>\"<regex>\")\" \(when *ALLOW-NAMED-REGISTERS* is T)
<legal-token>
where <flags> is parsed by the lexer function MAYBE-PARSE-FLAGS.
Will return <parse-tree> or \(<grouping-type> <parse-tree>) where
Expand Down
16 changes: 7 additions & 9 deletions src/lib/regex/public.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,8 @@ declarations."
(1+ ,match-end)
,match-end)))))))))

(defmacro do-matches ((match-start match-end regex
target-string
&optional result-form
&key start end)
(defmacro do-matches ((match-start match-end regex target-string result-form
&key start end)
&body body)
"Iterates over TARGET-STRING and tries to match REGEX as often as
possible evaluating BODY with MATCH-START and MATCH-END bound to the
Expand All @@ -350,9 +348,9 @@ declarations."
,@body)))

(defmacro do-matches-as-strings ((match-var regex
target-string
&optional result-form
&key start end sharedp)
target-string
result-form
&key start end sharedp)
&body body)
"Iterates over TARGET-STRING and tries to match REGEX as often as
possible evaluating BODY with MATCH-VAR bound to the substring of
Expand Down Expand Up @@ -463,7 +461,7 @@ match REGEX. If REGEX matches an empty string the scan is continued
one position behind this match. If SHAREDP is true, the substrings may
share structure with TARGET-STRING."
(let (result-list)
(do-matches-as-strings (match regex target-string (nreverse result-list)
(do-matches-as-strings (match regex target-string (nreverse result-list) nil
:start start :end end :sharedp sharedp)
(push match result-list))))

Expand Down Expand Up @@ -634,7 +632,7 @@ S-expression."))
;; COLLECTOR will hold the (reversed) template
(collector '()))
;; scan through all special parts of the replacement string
(do-matches (match-start match-end reg-scanner replacement-string)
(do-matches (match-start match-end reg-scanner replacement-string nil)
(when (< from match-start)
;; strings between matches are copied verbatim
(push (subseq replacement-string from match-start) collector))
Expand Down
6 changes: 0 additions & 6 deletions src/lib/regex/specials.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,3 @@ intended to handle `character properties' like \\p{IsAlpha}. If

(defvar *allow-quoting* nil
"Whether the parser should support Perl's \\Q and \\E.")

(defvar *allow-named-registers* nil
"Whether the parser should support AllegroCL's named registers
\(?<name>\"<regex>\") and back-reference \\k<name> syntax.")

(pushnew :lib.regex *features*)
41 changes: 0 additions & 41 deletions src/lib/type/sbcl-opt/fndb.lisp

This file was deleted.

92 changes: 0 additions & 92 deletions src/lib/type/sbcl-opt/nib-tran.lisp

This file was deleted.

Loading

0 comments on commit c978112

Please sign in to comment.