Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit e3054bd

Browse files
Noreturn type (#434)
1 parent df64bb5 commit e3054bd

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

grammars/php.cson

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,10 @@
689689
'match': '\\b(static)\\b',
690690
'name': 'storage.type.php'
691691
}
692+
{
693+
'match': '\\b(noreturn)\\b',
694+
'name': 'keyword.other.type.noreturn.php'
695+
}
692696
{
693697
'include': '#php-types'
694698
}

spec/php-spec.coffee

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,13 @@ describe 'PHP grammar', ->
17211721
expect(tokens[5]).toEqual value: '?', scopes: ["source.php", "meta.function.closure.php", "keyword.operator.nullable-type.php"]
17221722
expect(tokens[6]).toEqual value: 'Client', scopes: ["source.php", "meta.function.closure.php", "support.class.php"]
17231723

1724+
it 'tokenizes noreturn type', ->
1725+
{tokens} = grammar.tokenizeLine 'function app_exit() : noreturn {}'
1726+
1727+
expect(tokens[0]).toEqual value: 'function', scopes: ['source.php', 'meta.function.php', 'storage.type.function.php']
1728+
expect(tokens[6]).toEqual value: ':', scopes: ['source.php', 'meta.function.php', 'keyword.operator.return-value.php']
1729+
expect(tokens[8]).toEqual value: 'noreturn', scopes: ['source.php', 'meta.function.php', 'keyword.other.type.noreturn.php']
1730+
17241731
it 'tokenizes closure returning reference', ->
17251732
{tokens} = grammar.tokenizeLine 'function&() {}'
17261733

0 commit comments

Comments
 (0)