Emacs php-mode 字体锁定属性不适用于某些字符

发布于 2024-11-28 16:52:13 字数 301 浏览 2 评论 0原文

例如可变的美元符号。

php-mode.el 第 1087 行:

'("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable

如果我没记错的话,正则表达式应该匹配 $variable 包括美元符号。 现在,我试图弄清楚为什么字体锁定属性没有也应用于美元符号。 在语法表中,$ 被视为一个单词,就像 Az 一样。

所以我想我想问的是: 有没有人遇到过同样的问题并且他/她找到了解决方案吗?

For example variable dollar signs.

php-mode.el line 1087:

'("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable

If I'm not mistaken the regexp should match $variable including the dollar sign.
Now, i'm trying to figure out why isn't the font-lock property applied to the dollar sign also.
In the syntax table $ is considered a word just like A-z.

So i guess what i'm trying to ask is:
Did anyone experienced the same problem and has he/she found a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅浅 2024-12-05 16:52:13

其中的 1 表示匹配由(转义的)括号表示的第一个捕获组。 $ 位于该捕获组之外。因此,它可以移到内部,或者将 1 更改为 0,这意味着使用整个正则表达式。

The 1 in there means match the first capture group denoted by (escaped) parens. The $ is outside that capture group. So it could either be moved inside, or change the 1 to a 0 which means use the entire regexp.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文