Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C] Make function parameter names optional #4093

Merged
merged 1 commit into from
Nov 17, 2024
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 C++/C++.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,8 @@ contexts:
- match : \)
scope: punctuation.section.group.end.c++
set: function-definition-continue
- match: '\bvoid\b'
scope: storage.type.c++
- include: modifiers
- include: types
- match: '{{identifier}}(?=\s*(\[|,|\)|=))'
scope: variable.parameter.c++
- match: '='
Expand Down
4 changes: 2 additions & 2 deletions C++/C.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,8 @@ contexts:
- match : \)
scope: punctuation.section.group.end.c
set: function-definition-continue
- match: '\bvoid\b'
scope: storage.type.c
- include: modifiers
- include: types
- match: '{{identifier}}(?=\s*(\[|,|\)))'
scope: variable.parameter.c
- include: expressions
Expand Down
17 changes: 17 additions & 0 deletions C++/syntax_test_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,23 @@ struct UI_MenuBoxData
// Test preprocessor branching and C blocks
/////////////////////////////////////////////

int bar(int, int const *, int const * const);
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
/* ^ punctuation.section.group.begin */
/* ^ punctuation.section.group.end */
/* ^ punctuation.terminator */
/* ^^^ storage.type */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^^^^^ storage.modifier */

int foo(int val, float val2[])
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
Expand Down
17 changes: 17 additions & 0 deletions C++/syntax_test_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2547,6 +2547,23 @@ MyEnum MACRO1
// Test preprocessor branching and C blocks
/////////////////////////////////////////////

int bar(int, int const *, int const * const);
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
/* ^ punctuation.section.group.begin */
/* ^ punctuation.section.group.end */
/* ^ punctuation.terminator */
/* ^^^ storage.type */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^^^^^ storage.modifier */
deathaxe marked this conversation as resolved.
Show resolved Hide resolved

int foo(int val, float val2[], bool val3 = false)
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
Expand Down
4 changes: 2 additions & 2 deletions Objective-C/Objective-C++.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,8 @@ contexts:
- match : \)
scope: punctuation.section.group.end.objc++
set: function-definition-continue
- match: '\bvoid\b'
scope: storage.type.objc++
- include: modifiers
- include: types
- match: '{{identifier}}(?=\s*(\[|,|\)|=))'
scope: variable.parameter.objc++
- match: '='
Expand Down
4 changes: 2 additions & 2 deletions Objective-C/Objective-C.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ contexts:
- match : \)
scope: punctuation.section.group.end.objc
set: function-definition-continue
- match: '\bvoid\b'
scope: storage.type.objc
- include: modifiers
- include: types
- match: '{{identifier}}(?=\s*(\[|,|\)))'
scope: variable.parameter.objc
- include: expressions
Expand Down
17 changes: 17 additions & 0 deletions Objective-C/syntax_test_objc++.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2501,6 +2501,23 @@ T operator()(int a) {
// Test preprocessor branching and C blocks
/////////////////////////////////////////////

int bar(int, int const *, int const * const);
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
/* ^ punctuation.section.group.begin */
/* ^ punctuation.section.group.end */
/* ^ punctuation.terminator */
/* ^^^ storage.type */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^^^^^ storage.modifier */

int foo(int val, float val2[], bool val3 = false)
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
Expand Down
17 changes: 17 additions & 0 deletions Objective-C/syntax_test_objc.m
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,23 @@ int main(void)
// Test preprocessor branching and C blocks
/////////////////////////////////////////////

int bar(int, int const *, int const * const);
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
/* ^ punctuation.section.group.begin */
/* ^ punctuation.section.group.end */
/* ^ punctuation.terminator */
/* ^^^ storage.type */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^ punctuation.separator */
/* ^^^ storage.type */
/* ^^^^^ storage.modifier */
/* ^ keyword.operator */
/* ^^^^^ storage.modifier */

int foo(int val, float val2[])
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function */
/* ^^^^^^^^^^^^^^^^^^^^^^^ meta.function.parameters meta.group */
Expand Down