Skip to content

Commit

Permalink
temp fix for #230
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-hykin committed Jun 12, 2019
1 parent f1ab059 commit 324957c
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/languages/cpp/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,9 @@ def generateBlockFinder( name:"", tag_as:"", start_pattern:nil, needs_semicolon:
}
},
patterns: [
{
include: "#parameter_struct",
},
{
include: "#root_context"
}
Expand Down
3 changes: 3 additions & 0 deletions syntaxes/cpp.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -7013,6 +7013,9 @@
}
},
"patterns": [
{
"include": "#parameter_struct"
},
{
"include": "#root_context"
}
Expand Down
1 change: 1 addition & 0 deletions syntaxes/cpp.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,7 @@
'0':
name: punctuation.section.parens.end.bracket.round.cpp
patterns:
- include: "#parameter_struct"
- include: "#root_context"
parentheses_block:
name: meta.parens.block.cpp
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/issues/230.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void func()
{
struct var** thing = (struct var**)func(); //comment
}
83 changes: 83 additions & 0 deletions test/specs/issues/230.cpp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
- source: void
scopesBegin:
- source
- meta.function.definition
scopes:
- meta.qualified_type
- storage.type.primitive
- storage.type.built-in.primitive
- source: func
scopesBegin:
- meta.head.function.definition
scopes:
- entity.name.function.definition
- source: (
scopes:
- punctuation.section.parameters.begin.bracket.round
- source: )
scopes:
- punctuation.section.parameters.end.bracket.round
- source: '{'
scopes:
- punctuation.section.block.begin.bracket.curly.function.definition
scopesEnd:
- meta.head.function.definition
- source: struct
scopesBegin:
- meta.body.function.definition
scopes:
- storage.type.struct.declare
- source: var
scopes:
- entity.name.type.struct
- source: '**'
scopes:
- storage.modifier.pointer
- source: thing
scopes:
- variable.other.object.declare
- source: =
scopes:
- keyword.operator.assignment
- source: (
scopesBegin:
- meta.parens
scopes:
- punctuation.section.parens.begin.bracket.round
- source: struct
scopes:
- storage.type.struct.parameter
- source: var
scopes:
- entity.name.type.struct.parameter
- source: '**'
scopes:
- storage.modifier.pointer
- source: )
scopes:
- punctuation.section.parens.end.bracket.round
scopesEnd:
- meta.parens
- source: func
scopes:
- entity.name.function.call
- source: (
scopes:
- punctuation.section.arguments.begin.bracket.round.function.call
- source: )
scopes:
- punctuation.section.arguments.end.bracket.round.function.call
- source: ;
scopes:
- punctuation.terminator.statement
- source: //
scopesBegin:
- comment.line.double-slash
scopes:
- punctuation.definition.comment
- source: comment
scopesEnd:
- comment.line.double-slash
- source: '}'
scopes:
- punctuation.section.block.end.bracket.curly.function.definition

0 comments on commit 324957c

Please sign in to comment.