Allow _ characters in selector segments

This commit is contained in:
Kevin Sawicki
2013-08-06 15:21:31 -07:00
parent 612332cd9f
commit e61992c1f6
2 changed files with 3 additions and 1 deletions

View File

@@ -18,6 +18,8 @@ describe "TextMateScopeSelector", ->
expect(new TextMateScopeSelector('a.b').matches(['a.b-d'])).toBeFalsy()
expect(new TextMateScopeSelector('c++').matches(['c++'])).toBeTruthy()
expect(new TextMateScopeSelector('c++').matches(['c'])).toBeFalsy()
expect(new TextMateScopeSelector('a_b_c').matches(['a_b_c'])).toBeTruthy()
expect(new TextMateScopeSelector('a_b_c').matches(['a_b'])).toBeFalsy()
it "matches disjunction", ->
expect(new TextMateScopeSelector('a | b').matches(['b'])).toBeTruthy()

View File

@@ -7,7 +7,7 @@ start = _ selector:(selector) _ {
}
segment
= _ segment:([a-zA-Z0-9+]+[a-zA-Z0-9-+]*) _ {
= _ segment:([a-zA-Z0-9+_]+[a-zA-Z0-9-+_]*) _ {
return new matchers.SegmentMatcher(segment);
}