Skip to content

Commit ffc2ed2

Browse files
committed
Fixed assignment in parenthesis not receiving an expression scope
1 parent 733d59e commit ffc2ed2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

AngelScript.sublime-syntax

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,12 @@ contexts:
221221
- include: expression-in-parens
222222

223223
expression-has-operators:
224-
- match: '(?=@?\b({{identifier}}\.?)+\s*({{operators_assignment}}|\[))'
224+
- match: '(?=@?\(?\s*\b({{identifier}}\.?)+\s*\)?\s*({{operators_assignment}}|\[))'
225225
push:
226226
- match: '@'
227227
scope: keyword.other
228+
- match: '(?=\()'
229+
set: expression
228230
- match: '{{language_variables}}'
229231
scope: variable.language
230232
set: expression

syntax_test_stuff.as

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ uint g_bw = 1 | 2 | 3 & 4 & ~0xFF << 1 >> 2;
9595

9696
void bitstuff()
9797
{
98+
@(this.unit) = unit;
99+
// <- keyword.other
100+
// ^ punctuation.section.parens.begin
101+
// ^ punctuation.accessor
102+
// ^ punctuation.section.parens.end
103+
// ^ keyword.operator.assignment
104+
// ^^^^ variable.other
105+
// ^ punctuation.terminator
106+
this.x = 1;
107+
// <- variable.language
108+
98109
for (uint i = 0; i < m_skills.length(); i++)
99110
stuff();
100111
// <- entity.name.function

0 commit comments

Comments
 (0)