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

Replace noreturn with never #439

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions grammars/php.cson
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@
'name': 'storage.type.php'
}
{
'match': '\\b(noreturn)\\b',
'name': 'keyword.other.type.noreturn.php'
'match': '\\b(never)\\b',
'name': 'keyword.other.type.never.php'
}
{
'include': '#php-types'
Expand Down
6 changes: 3 additions & 3 deletions spec/php-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1721,12 +1721,12 @@ describe 'PHP grammar', ->
expect(tokens[5]).toEqual value: '?', scopes: ["source.php", "meta.function.closure.php", "keyword.operator.nullable-type.php"]
expect(tokens[6]).toEqual value: 'Client', scopes: ["source.php", "meta.function.closure.php", "support.class.php"]

it 'tokenizes noreturn type', ->
{tokens} = grammar.tokenizeLine 'function app_exit() : noreturn {}'
it 'tokenizes never type', ->
{tokens} = grammar.tokenizeLine 'function app_exit() : never {}'

expect(tokens[0]).toEqual value: 'function', scopes: ['source.php', 'meta.function.php', 'storage.type.function.php']
expect(tokens[6]).toEqual value: ':', scopes: ['source.php', 'meta.function.php', 'keyword.operator.return-value.php']
expect(tokens[8]).toEqual value: 'noreturn', scopes: ['source.php', 'meta.function.php', 'keyword.other.type.noreturn.php']
expect(tokens[8]).toEqual value: 'never', scopes: ['source.php', 'meta.function.php', 'keyword.other.type.never.php']

it 'tokenizes closure returning reference', ->
{tokens} = grammar.tokenizeLine 'function&() {}'
Expand Down