Emacs php-mode 字体锁定属性不适用于某些字符
例如可变的美元符号。
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其中的
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 the1
to a0
which means use the entire regexp.