Allow backslash and at-sign in user names, fix #171.

When connection to MS SQL it's sometimes needed to be able to use @ or \
as part of the username, which is now possible.
This commit is contained in:
Dimitri Fontaine 2015-02-11 11:56:52 +01:00
parent 3c1f18f4f5
commit b00e1bba7f

View File

@ -25,14 +25,15 @@
(defrule doubled-at-sign (and "@@") (:constant "@"))
(defrule doubled-colon (and "::") (:constant ":"))
(defrule password (+ (or (not "@") doubled-at-sign)) (:text t))
(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)))
(defrule username (and (or #\_ (alpha-char-p character))
(* (or (alpha-char-p character)
(digit-char-p character)
#\.
#\\
punct
doubled-at-sign
doubled-colon
)))
(:text t))
(defrule dsn-user-password (and username