Skip to content

Commit

Permalink
PHP: Added readonly keyword (#3349)
Browse files Browse the repository at this point in the history
Co-authored-by: RunDevelopment <mitchi5000.ms@googlemail.com>
  • Loading branch information
frankdejonge and RunDevelopment committed Mar 22, 2022
1 parent 1e941e8 commit 4c3f196
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 @@ -100,7 +100,7 @@
//
// keywords cannot be preceded by "->"
// the complex lookbehind means `(?<!(?:->|::)\s*)`
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?: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|match|namespace|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?: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|match|namespace|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\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 @@ -55,6 +55,7 @@ print
private
protected
public
readonly
require
require_once
return
Expand Down Expand Up @@ -135,6 +136,7 @@ yield from
["keyword", "private"],
["keyword", "protected"],
["keyword", "public"],
["keyword", "readonly"],
["keyword", "require"],
["keyword", "require_once"],
["keyword", "return"],
Expand Down

0 comments on commit 4c3f196

Please sign in to comment.