/
githubmirror
/
atom
Обзор
Документация
Войти
/
githubmirror
/
atom
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/token.coffee
25 строк
689 B
Indrek Ardel
Remove unused variables
26 сен 2016, 20:52
26 сен 2016, 20:52
55f3311
Код
Авторство
О чём код?
_ = require 'underscore-plus' StartDotRegex = /^\.?/ # Represents a single unit of text as selected by a grammar. module.exports = class Token value: null scopes: null constructor: (properties) -> {@value, @scopes} = properties isEqual: (other) -> # TODO: scopes is deprecated. This is here for the sake of lang package tests @value is other.value and _.isEqual(@scopes, other.scopes) isBracket: -> /^meta\.brace\b/.test(_.last(@scopes)) matchesScopeSelector: (selector) -> targetClasses = selector.replace(StartDotRegex, '').split('.') _.any @scopes, (scope) -> scopeClasses = scope.split('.') _.isSubset(targetClasses, scopeClasses)