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

Fix function name highlight #196

Merged
merged 2 commits into from May 15, 2017

Conversation

Projects
None yet
3 participants
@luxifer
Contributor

luxifer commented May 12, 2017

Description of the Change

According to http://php.net/manual/en/functions.user-defined.php function name can contains other characters than letters or numbers

Benefits

Atom can now highlight function name in php containing for example non breaking space:

function foo bar() {}

Possible Drawbacks

None

Applicable Issues

None

luxifer added some commits May 12, 2017

🐛 update function name highlight regex
according to http://php.net/manual/en/functions.user-defined.php
function name can contains more than letters and numbers
@@ -1350,7 +1350,7 @@
]
}
{
'begin': '(?x)\\s*\n\t\t\t\t\t ((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n\t\t\t\t (function)\n\t\t\t\t (?:\\s+|(\\s*&\\s*))\n\t\t\t\t (?:\n\t\t\t\t (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n\t\t\t\t |([a-zA-Z0-9_]+)\n\t\t\t\t )\n\t\t\t\t \\s*\n\t\t\t\t (\\()'
'begin': '(?x)\\s*\n\t\t\t\t\t ((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n\t\t\t\t (function)\n\t\t\t\t (?:\\s+|(\\s*&\\s*))\n\t\t\t\t (?:\n\t\t\t\t (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n\t\t\t\t |([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n\t\t\t\t )\n\t\t\t\t \\s*\n\t\t\t\t (\\()'

This comment has been minimized.

@50Wliu

50Wliu May 14, 2017

Member

Are the curly brackets around the 7f and ff needed? They don't appear to be necessary.

@50Wliu

50Wliu May 14, 2017

Member

Are the curly brackets around the 7f and ff needed? They don't appear to be necessary.

This comment has been minimized.

@Ingramz

Ingramz May 14, 2017

Contributor

Rest of the grammar uses curly brackets, probably worth getting rid all of them in a separate PR, if that's the case.

@Ingramz

Ingramz May 14, 2017

Contributor

Rest of the grammar uses curly brackets, probably worth getting rid all of them in a separate PR, if that's the case.

@50Wliu 50Wliu merged commit 22047c1 into atom:master May 15, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment