Doc TextMateScopeSelector

This commit is contained in:
Kevin Sawicki
2013-04-19 08:43:04 -07:00
parent f84402c4cf
commit 9b621f330b

View File

@@ -1,6 +1,7 @@
PEG = require 'pegjs'
fsUtils = require 'fs-utils'
# Public: Test a stack of scopes to see if they match a scope selector.
module.exports =
class TextMateScopeSelector
@parser: null
@@ -14,8 +15,16 @@ class TextMateScopeSelector
source: null
matcher: null
# Public: Create a new scope selector.
#
# source - A {String} to parse as a scope selector.
constructor: (@source) ->
@matcher = TextMateScopeSelector.createParser().parse(@source)
# Public: Check if this scope selector matches the scopes.
#
# scopes - An {Array} of {String}s.
#
# Return a {Boolean}.
matches: (scopes) ->
@matcher.matches(scopes)