mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Scope only the left side of assignments as vars…
…in C/C++.
This commit is contained in:
parent
7ee21c6e55
commit
5870276a6c
@ -102,22 +102,24 @@
|
||||
; Declarations and assignments
|
||||
; ----------------------------
|
||||
|
||||
; The "x" in `int x`;
|
||||
(declaration
|
||||
(identifier) @variable.declaration.c)
|
||||
declarator: (identifier) @variable.declaration.c)
|
||||
|
||||
; The "x" in `int x = y`;
|
||||
(init_declarator
|
||||
declarator: (identifier) @variable.declaration.c)
|
||||
|
||||
(field_declaration
|
||||
(field_identifier) @variable.declaration.c)
|
||||
|
||||
(field_declaration
|
||||
(pointer_declarator
|
||||
(field_identifier) @variable.declaration.c))
|
||||
(field_identifier) @variable.declaration.c))
|
||||
|
||||
(field_declaration
|
||||
(array_declarator
|
||||
(field_identifier) @variable.declaration.c))
|
||||
|
||||
(init_declarator
|
||||
(identifier) @variable.declaration.c)
|
||||
(field_identifier) @variable.declaration.c))
|
||||
|
||||
(init_declarator
|
||||
(pointer_declarator
|
||||
|
@ -162,8 +162,13 @@
|
||||
; Declarations and assignments
|
||||
; ----------------------------
|
||||
|
||||
; The "x" in `int x`;
|
||||
(declaration
|
||||
(identifier) @variable.declaration.cpp)
|
||||
declarator: (identifier) @variable.declaration.cpp)
|
||||
|
||||
; The "x" in `int x = y`;
|
||||
(init_declarator
|
||||
declarator: (identifier) @variable.declaration.cpp)
|
||||
|
||||
(field_declaration
|
||||
(field_identifier) @variable.declaration.cpp)
|
||||
@ -176,9 +181,6 @@
|
||||
(array_declarator
|
||||
(field_identifier) @variable.declaration.cpp))
|
||||
|
||||
(init_declarator
|
||||
(identifier) @variable.declaration.cpp)
|
||||
|
||||
(init_declarator
|
||||
(pointer_declarator
|
||||
(identifier) @variable.declaration.cpp))
|
||||
@ -186,6 +188,7 @@
|
||||
(assignment_expression
|
||||
left: (identifier) @variable.other.assignment.cpp)
|
||||
|
||||
|
||||
; Function parameters
|
||||
; -------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user