Skip to content

Commit

Permalink
fix for extern
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-hykin committed Apr 11, 2019
1 parent 29a1bf9 commit 84a65f7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions cpp/generate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -844,10 +844,12 @@ def blockFinderFor( name:"", tag_as:"", start_pattern:nil, needs_semicolon: true
subsequent_object_with_operator = variable_name_without_bounds.maybe(@spaces).then(member_operator.without_numbered_capture_groups).maybe(@spaces)
# TODO: the member_access and method_access can probably be simplified considerably
# TODO: member_access and method_access might also need additional matching to handle scope resolutions
partial_member = the_this_keyword.or(newPattern(
match: variable_name_without_bounds.or(lookBehindFor(/\]|\)/)).maybe(@spaces),
tag_as: "variable.other.object.access",
)).then(
partial_member = the_this_keyword.or(
newPattern(
match: variable_name_without_bounds.or(lookBehindFor(/\]|\)/)).maybe(@spaces),
tag_as: "variable.other.object.access",
)
).then(
member_operator
)
member_context = [
Expand Down Expand Up @@ -1141,11 +1143,11 @@ def blockFinderFor( name:"", tag_as:"", start_pattern:nil, needs_semicolon: true
extern_block = blockFinderFor(
name: 'extern',
tag_as: "meta.block.extern",

start_pattern: newPattern(
match: /\bextern/,
tag_as: "storage.type.extern"
).lookAheadFor(/\s*\"/),
head_includes: [ "$base" ],
secondary_includes: [ "$base" ]
)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Better C++ Syntax",
"description": "The bleeding edge of the VS Code C++ syntax",
"icon": "icon.png",
"version": "1.7.5",
"version": "1.7.6",
"engines": {
"vscode": "^1.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/cpp.tmLanguage.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions syntaxes/cpp.tmLanguage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,8 @@
:endCaptures:
'1':
:name: punctuation.section.block.begin.bracket.curly.extern.cpp
:patterns:
- :include: "$base"
- :name: meta.body.extern.cpp
:begin: "(?<=\\{)"
:end: "(\\})"
Expand Down

0 comments on commit 84a65f7

Please sign in to comment.