Introduce a new rule specific for username string

This allows dots in username.
This commit is contained in:
Pierre Ducroquet 2015-02-04 23:21:59 +01:00
parent 7ccbb45763
commit 894df76b36

View File

@ -25,7 +25,14 @@
(defrule doubled-at-sign (and "@@") (:constant "@")) (defrule doubled-at-sign (and "@@") (:constant "@"))
(defrule doubled-colon (and "::") (:constant ":")) (defrule doubled-colon (and "::") (:constant ":"))
(defrule password (+ (or (not "@") doubled-at-sign)) (:text t)) (defrule password (+ (or (not "@") doubled-at-sign)) (:text t))
(defrule username (and namestring (? (or doubled-at-sign doubled-colon))) (defrule username-string (and (or #\_ (alpha-char-p character))
(* (or (alpha-char-p character)
(digit-char-p character)
#\.
punct)))
(:text t))
(defrule username (and username-string (? (or doubled-at-sign doubled-colon)))
(:text t)) (:text t))
(defrule dsn-user-password (and username (defrule dsn-user-password (and username