Skip to content

Commit

Permalink
PHP: Added missing PHP 7.4 fn keyword (#2858)
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Apr 14, 2021
1 parent 3786f39 commit e0ee93f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/prism-php.js
Expand Up @@ -112,7 +112,7 @@
//
// keywords cannot be preceded by "->"
// the complex lookbehind means `(?<!(?:->|::)\s*)`
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
lookbehind: true
}
],
Expand Down
2 changes: 1 addition & 1 deletion components/prism-php.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/languages/php/keyword_feature.test
Expand Up @@ -30,6 +30,7 @@ exit
extends;
final
finally
fn
for
foreach
function
Expand Down Expand Up @@ -109,6 +110,7 @@ yield from
["keyword", "extends"], ["punctuation", ";"],
["keyword", "final"],
["keyword", "finally"],
["keyword", "fn"],
["keyword", "for"],
["keyword", "foreach"],
["keyword", "function"],
Expand Down

0 comments on commit e0ee93f

Please sign in to comment.