More Array -> Set
Make the syntax colouring run faster.
This commit is contained in:
parent
c212a53ad8
commit
7b7d2e80dc
|
@ -9,12 +9,12 @@ module Syntax
|
|||
end
|
||||
|
||||
ANSIC_KEYWORDS =
|
||||
%w{asm break case continue default do else for goto if return
|
||||
Set.new %w{asm break case continue default do else for goto if return
|
||||
switch while struct union enum typedef static register
|
||||
auto extern sizeof volatile const inline restrict} unless const_defined?(:ANSIC_KEYWORDS)
|
||||
|
||||
ANSIC_PREDEFINED_TYPES =
|
||||
%w{int long short char void signed unsigned
|
||||
Set.new %w{int long short char void signed unsigned
|
||||
float double bool complex} unless const_defined?(:ANSIC_PREDEFINED_TYPES)
|
||||
|
||||
ANSIC_PREDEFINED_CONSTANTS =
|
||||
|
|
|
@ -5,7 +5,7 @@ module Syntax
|
|||
class Javascript < Tokenizer
|
||||
|
||||
JAVASCRIPT_KEYWORDS =
|
||||
%w{abstract break case catch class const continue
|
||||
Set.new %w{abstract break case catch class const continue
|
||||
debugger default delete do else enum export extends
|
||||
final finally for function goto if implements
|
||||
import in instanceof interface native new
|
||||
|
@ -15,7 +15,7 @@ module Syntax
|
|||
var void volatile while with} unless const_defined?(:JAVASCRIPT_KEYWORDS)
|
||||
|
||||
JAVASCRIPT_PREDEFINED_TYPES =
|
||||
%w{boolean byte char double float int long short} unless const_defined?(:JAVASCRIPT_PREDEFINED_TYPES)
|
||||
Set.new %w{boolean byte char double float int long short} unless const_defined?(:JAVASCRIPT_PREDEFINED_TYPES)
|
||||
|
||||
JAVASCRIPT_PREDEFINED_CONSTANTS =
|
||||
%w{null true false} unless const_defined?(:JAVASCRIPT_PREDEFINED_CONSTANTS)
|
||||
|
|
|
@ -9,7 +9,7 @@ module Syntax
|
|||
|
||||
# The list of all identifiers recognized as keywords.
|
||||
KEYWORDS =
|
||||
%w{if then elsif else end begin do rescue ensure while for
|
||||
Set.new %w{if then elsif else end begin do rescue ensure while for
|
||||
class module def yield raise until unless and or not when
|
||||
case super undef break next redo retry in return alias
|
||||
defined?}
|
||||
|
|
Loading…
Reference in a new issue