diff --git a/docs/install.rst b/docs/install.rst index bb4ce1a..4cd2561 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -61,7 +61,7 @@ __ http://www.quicklisp.org/beta/ When building from sources, you should always build from the current git HEAD as it's basically the only source that is managed in a way to ensure it -builds aginst current set of dependencies versions. +builds against current set of dependencies versions. The build system for pgloader uses a Makefile and the Quicklisp Common Lisp packages distribution system. diff --git a/src/parsers/command-db-uri.lisp b/src/parsers/command-db-uri.lisp index edb8190..1421583 100644 --- a/src/parsers/command-db-uri.lisp +++ b/src/parsers/command-db-uri.lisp @@ -44,9 +44,6 @@ ;; password looks like '(":" "password") (list :user username :password (cadr password))))) -(defun hexdigit-char-p (character) - (member character #. (quote (coerce "0123456789abcdefABCDEF" 'list)))) - (defrule ipv4-part (and (digit-char-p character) (? (digit-char-p character)) (? (digit-char-p character)))) @@ -55,13 +52,13 @@ (:lambda (ipv4) (list :ipv4 (text ipv4)))) -(defrule ipv6 (and #\[ (+ (or (digit-char-p character) ":")) #\]) +(defrule ipv6 (and #\[ (+ (or (hexdigit-char-p character) ":")) #\]) (:lambda (ipv6) (list :ipv6 (text ipv6)))) -;;; socket directory is unix only, so we can forbid ":" on the parsing +;; socket directory is unix only, so we can forbid ":" on the parsing (defun socket-directory-character-p (char) - (or (member char #.(quote (coerce "/.-_" 'list))) + (or (find char "/.-_") (alphanumericp char))) (defrule socket-directory (and "unix:" diff --git a/src/parsers/command-utils.lisp b/src/parsers/command-utils.lisp index 4ad3a63..a2639a9 100644 --- a/src/parsers/command-utils.lisp +++ b/src/parsers/command-utils.lisp @@ -65,3 +65,7 @@ (defrule comma-separator (and ignore-whitespace #\, ignore-whitespace) (:constant ",")) + +;; Predicates for use in rules can only be called with arity 1. +(defun hexdigit-char-p (character) + (digit-char-p character 16)) diff --git a/src/parsers/parse-pgpass.lisp b/src/parsers/parse-pgpass.lisp index 5f62aba..84a6d37 100644 --- a/src/parsers/parse-pgpass.lisp +++ b/src/parsers/parse-pgpass.lisp @@ -15,7 +15,7 @@ (:lambda (c) (second c))) (defrule pgpass-ipv6-hostname (and #\[ - (+ (or (digit-char-p character) ":")) + (+ (or (hexdigit-char-p character) ":")) #\]) (:lambda (ipv6) (text (second ipv6))))