unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christian Johansson <christian@cvj.se>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: [ELPA] New package: phps-mode
Date: Wed, 17 Jul 2019 07:43:23 +0200	[thread overview]
Message-ID: <aeeb8469-406c-3f36-9414-82a48a1e4a0c@cvj.se> (raw)
In-Reply-To: <713AB63A-5E2C-4D07-9D96-AFB7DD1ADEDA@acm.org>

Hi!

Thanks for your review, I should have fixed all those items now and 
pushed them to ELPA

Best Regards
Christian

On 2019-07-16 12:00, Mattias Engdegård wrote:
> Thank you for your contribution! A regexp scan on phps-mode, using relint, found some irregularities. Summary here, along with some things that relint didn't catch:
>
> php-mode-lexer.el:160:
> (defvar phps-mode-lexer-TOKENS "[][;\\:,\.()|^&+-/*=%!~\\$<>?@]"
>
> The hyphen (-) is special and should be placed last to avoid being interpreted as a range.
>
> The lone backslash in front of the dot has no effect, since backslashes must be doubled inside string literals.
> On the regexp level, backslashes are not special inside [...] and only represent themselves, with no escaping power. This regexp includes it multiple times which was probably unintended.
>
> php-mode-lexer.el:1367:
>                     (if (looking-at "[^\\\\]\"")
>
> No need to double the backslash; it's not special inside [...].
>
> php-mode-lexer.el:151:
>    "[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*"
>
> Hex and octal escapes in the 128-255 range do not denote Unicode (Latin-1) characters but raw bytes, which you likely did not intend to match here. To match U+0080-U+00FF, write "\u0080-\u00FF". I don't know PHP's lexing rules, but if you want to match Unicode identifiers, you'd be better off using something like "[[:alpha:]_][[:alnum:]_]*", or syntax classes.
>
> php-mode-functions.el:990:
>              (when (looking-at-p " \\*\/")
>
> Ineffective backslash before `/', which does not need escaping anyway.
> The same pattern (`\/') occurs in several other places in this file.
>



  reply	other threads:[~2019-07-17  5:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 10:00 [ELPA] New package: phps-mode Mattias Engdegård
2019-07-17  5:43 ` Christian Johansson [this message]
2019-07-17  8:44   ` Mattias Engdegård
2019-07-17  9:36     ` Christian Johansson
2019-07-17 12:24       ` Stefan Monnier
2019-07-17 20:27     ` Christian Johansson
  -- strict thread matches above, loose matches on Subject: below --
2019-07-12 17:15 Christian Johansson
2019-07-12 22:35 ` Stephen Leake
2019-07-12 23:36 ` Lars Ingebrigtsen
2019-07-13 13:14   ` Stefan Monnier
2019-07-13 13:28     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aeeb8469-406c-3f36-9414-82a48a1e4a0c@cvj.se \
    --to=christian@cvj.se \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).