Skip to content

Commit 4c3f196

Browse files
frankdejongeRunDevelopment
andauthoredMar 22, 2022
PHP: Added readonly keyword (#3349)
Co-authored-by: RunDevelopment <mitchi5000.ms@googlemail.com>
1 parent 1e941e8 commit 4c3f196

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
 

‎components/prism-php.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
//
101101
// keywords cannot be preceded by "->"
102102
// the complex lookbehind means `(?<!(?:->|::)\s*)`
103-
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,
103+
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,
104104
lookbehind: true
105105
}
106106
],

‎components/prism-php.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/php/keyword_feature.test

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ print
5555
private
5656
protected
5757
public
58+
readonly
5859
require
5960
require_once
6061
return
@@ -135,6 +136,7 @@ yield from
135136
["keyword", "private"],
136137
["keyword", "protected"],
137138
["keyword", "public"],
139+
["keyword", "readonly"],
138140
["keyword", "require"],
139141
["keyword", "require_once"],
140142
["keyword", "return"],

0 commit comments

Comments
 (0)
Please sign in to comment.