Skip to content

Commit

Permalink
Fix issue #8 and update the tests, which now pass
Browse files Browse the repository at this point in the history
  • Loading branch information
samcv committed Dec 14, 2016
1 parent 44e54e0 commit d350c1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion grammars/perl6fe.cson
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@

# Dual functions and methods
{
'match': '(?x)\\b(?<![\\-:]|\\\\)(
'match': '(?x)\\b(?<![\\-:\\\\])( :: )?(
eager|hyper|substr|index|rindex|grep|map|sort|join|lines|hints
|chmod|split|reduce|min|max|reverse|truncate|zip|cat|roundrobin
|classify|first|sum|keys|values|pairs|defined|delete|exists
Expand Down Expand Up @@ -943,6 +943,9 @@
|starts-with|ends-with|put|append|tail|\\x{03C0}|\\x{03C4}|\\x{212F}
|get|words|new-from-pairs|uniname|uninames|uniprop|uniprops
)(?!\\-)\\b(?!\\s*=>)'
'captures':
'1':
'name': 'keyword.operator.colon.perl6fe'
'name': 'support.function.perl6fe'
}
# Methods Only
Expand Down
6 changes: 5 additions & 1 deletion spec/grammar-perl6fe-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ describe "Perl 6 FE grammar", ->
#it "# =begin pod works", ->
# line = " =comment Perl 6 is the Best!"
# expect(grammar.firstLineRegex.scanner.findNextMatchSync(line)).not.toBeNull()
it "FQ private methods are highlighted properly Issue #8", ->
it "FQ private methods are highlighted properly Issue 8", ->
{tokens} = grammar.tokenizeLine "self.List::perl;"
expect(tokens[0]).toEqual value : 'self',
scopes : [ 'source.perl6fe', 'variable.language.perl6fe' ]
expect(tokens[1]).toEqual value : '.',
scopes : [ 'source.perl6fe', 'keyword.operator.generic.perl6fe' ]
expect(tokens[2]).toEqual value : 'List',
scopes : [ 'source.perl6fe', 'support.type.perl6fe' ]
expect(tokens[3]).toEqual value : '::',
scopes : [ 'source.perl6fe', 'support.function.perl6fe', 'keyword.operator.colon.perl6fe' ]
expect(tokens[4]).toEqual value : 'perl',
scopes : [ 'source.perl6fe', 'support.function.perl6fe' ]
it "self.perl highlights", ->
{tokens} = grammar.tokenizeLine "self.perl"
Expand Down

0 comments on commit d350c1a

Please sign in to comment.