This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move rules from TypeScript lexer to TypeScript common module (rouge-r…
…uby#1530) The TypeScript lexer was refactored in a previous commit to move its memoisation methods into a module that could be mixed in by the TSX lexer. This is because the TSX lexer needs to inherit from both the TypeScript lexer and the JSX lexer but can't do that direclty because Ruby does not support multiple inheritance. While the memoisation methods were moved, changes to states of TypeScript lexer were not refactored out. This means that the TypeScript and TSX lexers can lex the same code differently. This commit fixes that problem by adopting the same approach used with the ObjectiveC common module: using Ruby's `Module#extended` hook.
- Loading branch information