Skip to content

Commit 09cb091

Browse files
committed
Merge branch 'Fix/#264'
2 parents ee409a8 + 6df0314 commit 09cb091

File tree

8 files changed

+344
-83
lines changed

8 files changed

+344
-83
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ todo.txt
33
node_modules
44
**/.vscode/ipch
55
**/.vscode/settings.json
6+
report.json
67
node_modules

report.json

Lines changed: 0 additions & 80 deletions
This file was deleted.

source/languages/cpp/generate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ def generateBlockFinder( name:"", tag_as:"", start_pattern:nil, needs_semicolon:
17591759
should_fully_match: [ "[]", "[=]", "[&]", "[x,y,x]", "[x, y, &z, w = 1 + 1]", "[ a = blah[1324], b, c ]" ],
17601760
should_partial_match: [ "[]", "[=](", "[&]{", "[x,y,x]", "[x, y, &z, w = 1 + 1] (", "[ a = blah[1324], b, c ] {" ],
17611761
should_not_partial_match: [ "delete[]", "thing[]", "thing []", "thing []", "thing[0][0] = 0" ],
1762-
match: lookBehindFor(/[^\s]|^/).lookBehindToAvoid(/[\w\]\)\[\*&>]/).or(lookBehindFor(non_variable_name)).maybe(@spaces).then(
1762+
match: lookBehindFor(/[^\s]|^/).lookBehindToAvoid(/[\w\]\)\[\*&">]/).or(lookBehindFor(non_variable_name)).maybe(@spaces).then(
17631763
match: /\[/.lookAheadToAvoid(/\[/),
17641764
tag_as: "punctuation.definition.capture.begin.lambda",
17651765
).then(

syntaxes/cpp.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7553,7 +7553,7 @@
75537553
"name": "variable.other.macro.argument.cpp"
75547554
},
75557555
"lambdas": {
7556-
"begin": "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*&>])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))",
7556+
"begin": "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*&\">])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))",
75577557
"beginCaptures": {
75587558
"2": {
75597559
"name": "punctuation.definition.capture.begin.lambda.cpp"

syntaxes/cpp.tmLanguage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,7 @@
39143914
match: "##(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w)"
39153915
name: variable.other.macro.argument.cpp
39163916
lambdas:
3917-
begin: "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*&>])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))"
3917+
begin: ((?:(?<=[^\s]|^)(?<![\w\]\)\[\*&">])|(?<=\Wreturn|^return))\s*(\[(?!\[))((?:.*\[.*?\].*?)*.*?)(\]))
39183918
beginCaptures:
39193919
'2':
39203920
name: punctuation.definition.capture.begin.lambda.cpp

test/fixtures/issues/264.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
void func() {
2+
printf("%d\n", N);
3+
for(int i = 1; i <= N; ++i)
4+
printf("%d%c",randint(1,1000000006), " \n"[i==N]);
5+
6+
static int perm[N + 1];
7+
for(int i = 1; i <= N; ++i)
8+
perm[i] = i;
9+
std::shuffle(perm + 1, perm + 1 + N, gen)
10+
// std::shuffle(perm + 1, prem + N, perm + 1 + N)
11+
}

test/specs/issues/134.cpp.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
- punctuation.section.parameters.begin.bracket.round.function.pointer
125125
- source: Type
126126
scopes:
127+
- meta.parameter
127128
- entity.name.type.parameter
128129
- source: )
129130
scopes:
@@ -179,6 +180,7 @@
179180
- punctuation.section.parameters.begin.bracket.round.function.pointer
180181
- source: Type
181182
scopes:
183+
- meta.parameter
182184
- entity.name.type.parameter
183185
- source: )
184186
scopes:
@@ -308,6 +310,7 @@
308310
- punctuation.section.parameters.begin.bracket.round.function.pointer
309311
- source: Type
310312
scopes:
313+
- meta.parameter
311314
- entity.name.type.parameter
312315
- source: )
313316
scopes:
@@ -367,6 +370,7 @@
367370
- punctuation.section.parameters.begin.bracket.round.function.pointer
368371
- source: Type
369372
scopes:
373+
- meta.parameter
370374
- entity.name.type.parameter
371375
- source: )
372376
scopes:

0 commit comments

Comments
 (0)