Skip to content

Commit

Permalink
Merge branch 'Fix/#264'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-hykin committed Jun 27, 2019
2 parents ee409a8 + 6df0314 commit 09cb091
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ todo.txt
node_modules
**/.vscode/ipch
**/.vscode/settings.json
report.json
node_modules
80 changes: 0 additions & 80 deletions report.json

This file was deleted.

2 changes: 1 addition & 1 deletion source/languages/cpp/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ def generateBlockFinder( name:"", tag_as:"", start_pattern:nil, needs_semicolon:
should_fully_match: [ "[]", "[=]", "[&]", "[x,y,x]", "[x, y, &z, w = 1 + 1]", "[ a = blah[1324], b, c ]" ],
should_partial_match: [ "[]", "[=](", "[&]{", "[x,y,x]", "[x, y, &z, w = 1 + 1] (", "[ a = blah[1324], b, c ] {" ],
should_not_partial_match: [ "delete[]", "thing[]", "thing []", "thing []", "thing[0][0] = 0" ],
match: lookBehindFor(/[^\s]|^/).lookBehindToAvoid(/[\w\]\)\[\*&>]/).or(lookBehindFor(non_variable_name)).maybe(@spaces).then(
match: lookBehindFor(/[^\s]|^/).lookBehindToAvoid(/[\w\]\)\[\*&">]/).or(lookBehindFor(non_variable_name)).maybe(@spaces).then(
match: /\[/.lookAheadToAvoid(/\[/),
tag_as: "punctuation.definition.capture.begin.lambda",
).then(
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/cpp.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -7553,7 +7553,7 @@
"name": "variable.other.macro.argument.cpp"
},
"lambdas": {
"begin": "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*&>])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))",
"begin": "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*&\">])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))",
"beginCaptures": {
"2": {
"name": "punctuation.definition.capture.begin.lambda.cpp"
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/cpp.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,7 @@
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)"
name: variable.other.macro.argument.cpp
lambdas:
begin: "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*&>])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))"
begin: ((?:(?<=[^\s]|^)(?<![\w\]\)\[\*&">])|(?<=\Wreturn|^return))\s*(\[(?!\[))((?:.*\[.*?\].*?)*.*?)(\]))
beginCaptures:
'2':
name: punctuation.definition.capture.begin.lambda.cpp
Expand Down
11 changes: 11 additions & 0 deletions test/fixtures/issues/264.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
void func() {
printf("%d\n", N);
for(int i = 1; i <= N; ++i)
printf("%d%c",randint(1,1000000006), " \n"[i==N]);

static int perm[N + 1];
for(int i = 1; i <= N; ++i)
perm[i] = i;
std::shuffle(perm + 1, perm + 1 + N, gen)
// std::shuffle(perm + 1, prem + N, perm + 1 + N)
}
4 changes: 4 additions & 0 deletions test/specs/issues/134.cpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
- punctuation.section.parameters.begin.bracket.round.function.pointer
- source: Type
scopes:
- meta.parameter
- entity.name.type.parameter
- source: )
scopes:
Expand Down Expand Up @@ -179,6 +180,7 @@
- punctuation.section.parameters.begin.bracket.round.function.pointer
- source: Type
scopes:
- meta.parameter
- entity.name.type.parameter
- source: )
scopes:
Expand Down Expand Up @@ -308,6 +310,7 @@
- punctuation.section.parameters.begin.bracket.round.function.pointer
- source: Type
scopes:
- meta.parameter
- entity.name.type.parameter
- source: )
scopes:
Expand Down Expand Up @@ -367,6 +370,7 @@
- punctuation.section.parameters.begin.bracket.round.function.pointer
- source: Type
scopes:
- meta.parameter
- entity.name.type.parameter
- source: )
scopes:
Expand Down
Loading

0 comments on commit 09cb091

Please sign in to comment.