Skip to content

Commit 82c3be6

Browse files
author
Raul E Rangel
committed
[C] Allow declaring a struct pointer in a struct
Fixes sublimehq#1830 Signed-off-by: Raul E Rangel <[email protected]>
1 parent 2c2772b commit 82c3be6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

C++/C.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ contexts:
451451

452452
data-structures:
453453
# Detect variable type definitions using struct/enum/union followed by a tag
454-
- match: '\b({{before_tag}})(?=\s+{{identifier}}\s+{{identifier}}\s*[=;\[])'
454+
- match: '\b({{before_tag}})(?=\s+{{identifier}}\s+\**{{identifier}}\s*[=;\[])'
455455
scope: storage.type.c
456456
- match: '\bstruct\b'
457457
scope: storage.type.c

C++/syntax_test_c.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ struct foo MACRO {
313313
/* ^ - entity.name */
314314
}
315315

316+
struct UI_BoundingBox *position_p;
317+
/* ^ - entity.name */
318+
/* ^ - entity.name */
319+
316320
// Partially-typed
317321
struct foo
318322
/* ^ entity.name */
@@ -324,6 +328,9 @@ struct UI_MenuBoxData
324328
struct UI_BoundingBox position;
325329
/* ^ - entity.name */
326330
/* ^ - entity.name */
331+
struct UI_BoundingBox *position_p;
332+
/* ^ - entity.name */
333+
/* ^ - entity.name */
327334
enum UI_BoxCharType borderType;
328335
/* ^ - entity.name */
329336
/* ^ - entity.name */

0 commit comments

Comments
 (0)