Closed nsfisis closed 1 year ago
cf. https://github.com/rouge-ruby/rouge/pull/1939#issuecomment-1532634686
Wollok lexer had entities class variable to track defined entities, e.g., class, object.
Wollok
entities
If a token is included in entities, it will be recognized as Name.Class; if not, Keyword.Variable
if entities.include?(variable) || ('A'..'Z').cover?(variable[0]) token Name::Class else token Keyword::Variable end
Since a class variable is shared between instances, each lexer shared entity list.
I changed entities to an instance variable.
cf. https://github.com/rouge-ruby/rouge/pull/1939#issuecomment-1532634686
Problem
Wollok
lexer hadentities
class variable to track defined entities, e.g., class, object.If a token is included in
entities
, it will be recognized as Name.Class; if not, Keyword.VariableSince a class variable is shared between instances, each lexer shared entity list.
Solution
I changed
entities
to an instance variable.