Skip to content

Commit

Permalink
pull out true, false and null from keywords:
Browse files Browse the repository at this point in the history
we already had a rule to handle their lower case form,
just make it case insensitive.
  • Loading branch information
julp committed Jan 22, 2020
1 parent c03c003 commit 146cd98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rouge/lexers/php.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def builtins
def self.keywords
@keywords ||= Set.new %w(
and E_PARSE old_function E_ERROR or as E_WARNING parent eval
PHP_OS break exit case extends PHP_VERSION cfunction false
PHP_OS break exit case extends PHP_VERSION cfunction
print for require continue foreach require_once declare return
default static do switch die stdclass echo else true elseif
default static do switch die stdclass echo else elseif
var empty if xor enddeclare include virtual endfor include_once
while endforeach global __file__ endif list __line__ endswitch
new __sleep endwhile not array __wakeup E_ALL null final
new __sleep endwhile not array __wakeup E_ALL final
php_user_filter interface implements public private protected
abstract clone try catch finally throw this use namespace yield
fn callable insteadof trait __trait__ goto __namespace__ __dir__
Expand Down Expand Up @@ -139,7 +139,7 @@ def self.detect?(text)
groups Keyword, Text, Name::Constant
end

rule %r/(true|false|null)\b/, Keyword::Constant
rule %r/(true|false|null)\b/i, Keyword::Constant
rule %r/(?:void|\??(?:int|float|bool|string|iterable|self|callable))\b/i, Keyword::Type
rule %r/\$\{\$+#{id}\}/i, Name::Variable
rule %r/\$+#{id}/i, Name::Variable
Expand Down

0 comments on commit 146cd98

Please sign in to comment.