mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Support selectors with a trailing comma
This commit is contained in:
@@ -42,6 +42,8 @@ describe "TextMateScopeSelector", ->
|
||||
expect(new TextMateScopeSelector('a,b,c').matches(['b', 'c'])).toBeTruthy()
|
||||
expect(new TextMateScopeSelector('a, b, c').matches(['d', 'e'])).toBeFalsy()
|
||||
expect(new TextMateScopeSelector('a, b, c').matches(['d', 'c.e'])).toBeTruthy()
|
||||
expect(new TextMateScopeSelector('a,').matches(['a', 'c'])).toBeTruthy()
|
||||
expect(new TextMateScopeSelector('a,').matches(['b', 'c'])).toBeFalsy()
|
||||
|
||||
it "matches groups", ->
|
||||
expect(new TextMateScopeSelector('(a,b) | (c, d)').matches(['a'])).toBeTruthy()
|
||||
|
||||
@@ -40,8 +40,11 @@ composite
|
||||
/ expression
|
||||
|
||||
selector
|
||||
= left:composite _ "," _ right:selector {
|
||||
return new matchers.OrMatcher(left, right);
|
||||
= left:composite _ "," _ right:selector? {
|
||||
if (right)
|
||||
return new matchers.OrMatcher(left, right);
|
||||
else
|
||||
return left;
|
||||
}
|
||||
|
||||
/ composite
|
||||
|
||||
Reference in New Issue
Block a user