More Array -> Set

Make the syntax colouring run faster.
This commit is contained in:
Jacques Distler 2010-01-02 11:22:12 -06:00
parent c212a53ad8
commit 7b7d2e80dc
3 changed files with 5 additions and 5 deletions

View file

@ -9,12 +9,12 @@ module Syntax
end end
ANSIC_KEYWORDS = 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 switch while struct union enum typedef static register
auto extern sizeof volatile const inline restrict} unless const_defined?(:ANSIC_KEYWORDS) auto extern sizeof volatile const inline restrict} unless const_defined?(:ANSIC_KEYWORDS)
ANSIC_PREDEFINED_TYPES = 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) float double bool complex} unless const_defined?(:ANSIC_PREDEFINED_TYPES)
ANSIC_PREDEFINED_CONSTANTS = ANSIC_PREDEFINED_CONSTANTS =

View file

@ -5,7 +5,7 @@ module Syntax
class Javascript < Tokenizer class Javascript < Tokenizer
JAVASCRIPT_KEYWORDS = 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 debugger default delete do else enum export extends
final finally for function goto if implements final finally for function goto if implements
import in instanceof interface native new import in instanceof interface native new
@ -15,7 +15,7 @@ module Syntax
var void volatile while with} unless const_defined?(:JAVASCRIPT_KEYWORDS) var void volatile while with} unless const_defined?(:JAVASCRIPT_KEYWORDS)
JAVASCRIPT_PREDEFINED_TYPES = 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 = JAVASCRIPT_PREDEFINED_CONSTANTS =
%w{null true false} unless const_defined?(:JAVASCRIPT_PREDEFINED_CONSTANTS) %w{null true false} unless const_defined?(:JAVASCRIPT_PREDEFINED_CONSTANTS)

View file

@ -9,7 +9,7 @@ module Syntax
# The list of all identifiers recognized as keywords. # The list of all identifiers recognized as keywords.
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 class module def yield raise until unless and or not when
case super undef break next redo retry in return alias case super undef break next redo retry in return alias
defined?} defined?}