Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of rx-form #580

Merged
merged 2 commits into from
Sep 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions php.el
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,24 @@ keywords that can appear in method signatures, e.g. 'final' and
which will be the name of the method."
(when (stringp visibility)
(setq visibility (list visibility)))
(rx-form `(: line-start
(* (syntax whitespace))
,@(if visibility
`((* (or "abstract" "final" "static")
(+ (syntax whitespace)))
(or ,@visibility)
(+ (syntax whitespace))
(* (or "abstract" "final" "static")
(+ (syntax whitespace))))
'((* (* (or "abstract" "final" "static"
"private" "protected" "public")
(+ (syntax whitespace))))))
"function"
(+ (syntax whitespace))
(? "&" (* (syntax whitespace)))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace))
"(")))
(rx-to-string `(: line-start
(* (syntax whitespace))
,@(if visibility
`((* (or "abstract" "final" "static")
(+ (syntax whitespace)))
(or ,@visibility)
(+ (syntax whitespace))
(* (or "abstract" "final" "static")
(+ (syntax whitespace))))
'((* (* (or "abstract" "final" "static"
"private" "protected" "public")
(+ (syntax whitespace))))))
"function"
(+ (syntax whitespace))
(? "&" (* (syntax whitespace)))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace))
"(")))

(defun php-create-regexp-for-classlike (type)
"Accepts a `TYPE' of a 'classlike' object as a string, such as
Expand Down Expand Up @@ -393,9 +393,8 @@ When `DOCUMENT-ROOT' is NIL, the document root is obtained from `ROUTER-OR-DIR'.
(if (file-directory-p router-or-dir)
router-or-dir
(directory-file-name router-or-dir))))
(pattern (rx-form `(: bos ,(getenv "HOME"))))
(short-dirname (replace-regexp-in-string pattern "~" default-directory))
(short-filename (replace-regexp-in-string pattern "~" router-or-dir))
(short-dirname (abbreviate-file-name default-directory))
(short-filename (abbreviate-file-name router-or-dir))
(buf-name (format "php -S %s:%s -t %s %s"
hostname
port
Expand Down