Skip to content

Commit

Permalink
better support for initlizers and ranged assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-hykin committed Jul 11, 2024
1 parent c48cb96 commit 01ca0d4
Show file tree
Hide file tree
Showing 20 changed files with 2,928 additions and 79 deletions.
2 changes: 1 addition & 1 deletion autogenerated/cpp.embedded.macro.tmLanguage.json

Large diffs are not rendered by default.

499 changes: 491 additions & 8 deletions autogenerated/cpp.tmLanguage.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions autogenerated/cpp_scopes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ constant.numeric.exponent.hexadecimal.cpp
constant.numeric.hexadecimal.cpp
constant.numeric.octal.cpp
constant.other.placeholder
entity.name.function.call.constructor.cpp
entity.name.function.call.cpp
entity.name.function.call.initializer.cpp
entity.name.function.constructor.cpp
Expand Down
13 changes: 12 additions & 1 deletion language_examples/#071.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,15 @@ usertype user_value{'A'};
scoped::templated<type> value;
compound<typename templated::type *>::type value;
int a[] = {1,2,3};
void function_declaration(int *, usertype user_value);
function_declaration(int *, usertype user_value);

int main() {
int a;
int b;
usertype user_value;
usertype user_value{'A'};
scoped::templated<type> value;
compound<typename templated::type *>::type value;
int a[] = {1,2,3};
function_declaration(int *, usertype user_value);
}
286 changes: 267 additions & 19 deletions language_examples/#071.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@
- source: ;
scopes:
- punctuation.terminator.statement
- source: ' usertype user_value'
- source: usertype
scopes:
- meta.qualified_type
- entity.name.type
- source: user_value
scopes:
- entity.name.function.call.constructor
- source: '{'
scopesBegin:
- meta.block
Expand Down Expand Up @@ -74,7 +80,15 @@
scopes:
- storage.type.primitive
- storage.type.built-in.primitive
- source: ' a[] '
- source: a
scopes:
- variable.other.assignment
- source: '['
scopes:
- punctuation.definition.begin.bracket.square.array.type
- source: ']'
scopes:
- punctuation.definition.end.bracket.square.array.type
- source: '='
scopes:
- keyword.operator.assignment
Expand Down Expand Up @@ -221,7 +235,13 @@
- source: ;
scopes:
- punctuation.terminator.statement
- source: usertype user_value
- source: usertype
scopes:
- meta.qualified_type
- entity.name.type
- source: user_value
scopes:
- entity.name.function.call.constructor
- source: '{'
scopesBegin:
- meta.block
Expand Down Expand Up @@ -312,7 +332,15 @@
scopes:
- storage.type.primitive
- storage.type.built-in.primitive
- source: ' a[] '
- source: a
scopes:
- variable.other.assignment
- source: '['
scopes:
- punctuation.definition.begin.bracket.square.array.type
- source: ']'
scopes:
- punctuation.definition.end.bracket.square.array.type
- source: '='
scopes:
- keyword.operator.assignment
Expand Down Expand Up @@ -344,49 +372,269 @@
- source: ;
scopes:
- punctuation.terminator.statement
- source: void
- source: function_declaration
scopes:
- entity.name.function.call
- source: (
scopes:
- punctuation.section.arguments.begin.bracket.round.function.call
- source: int
scopes:
- storage.type.primitive
- storage.type.built-in.primitive
- source: '*'
scopes:
- keyword.operator.arithmetic
- source: ','
scopes:
- punctuation.separator.delimiter.comma
- source: ' usertype user_value'
- source: )
scopes:
- punctuation.section.arguments.end.bracket.round.function.call
- source: ;
scopes:
- punctuation.terminator.statement
- source: int
scopesBegin:
- meta.function.definition
scopes:
- meta.qualified_type
- storage.type.primitive
- storage.type.built-in.primitive
- source: function_declaration
- source: main
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: int
scopesBegin:
- meta.function.definition.parameters
- meta.parameter
- meta.body.function.definition
scopes:
- meta.qualified_type
- storage.type.primitive
- storage.type.built-in.primitive
- source: a
scopes:
- variable.other.object.declare
- source: ;
scopes:
- punctuation.terminator.statement
- source: int
scopes:
- meta.qualified_type
- storage.type.primitive
- storage.type.built-in.primitive
- source: b
scopes:
- variable.other.object.declare
- source: ;
scopes:
- punctuation.terminator.statement
- source: usertype
scopes:
- meta.qualified_type
- entity.name.type
- source: user_value
scopes:
- variable.other.object.declare
- source: ;
scopes:
- punctuation.terminator.statement
- source: usertype
scopes:
- meta.qualified_type
- entity.name.type
- source: user_value
scopes:
- entity.name.function.call.constructor
- source: '{'
scopesBegin:
- meta.block
scopes:
- punctuation.section.block.begin.bracket.curly
- source: ''''
scopesBegin:
- string.quoted.single
scopes:
- punctuation.definition.string.begin
- source: A
- source: ''''
scopes:
- punctuation.definition.string.end
scopesEnd:
- string.quoted.single
- source: '}'
scopes:
- punctuation.section.block.end.bracket.curly
scopesEnd:
- meta.block
- source: ;
scopes:
- punctuation.terminator.statement
- source: scoped
scopesBegin:
- meta.qualified_type
scopes:
- entity.name.scope-resolution
- source: '::'
scopes:
- punctuation.separator.namespace.access
- punctuation.separator.scope-resolution
- source: templated
scopes:
- entity.name.type
- source: <
scopesBegin:
- meta.template.call
scopes:
- punctuation.section.angle-brackets.begin.template.call
- source: type
scopes:
- meta.qualified_type
- entity.name.type
- source: '>'
scopes:
- punctuation.section.angle-brackets.end.template.call
scopesEnd:
- meta.qualified_type
- meta.template.call
- source: value
scopes:
- variable.other.object.declare
- source: ;
scopes:
- punctuation.terminator.statement
- source: compound
scopesBegin:
- meta.qualified_type
scopes:
- entity.name.scope-resolution
- source: <
scopesBegin:
- meta.template.call
- meta.template.call
scopes:
- punctuation.section.angle-brackets.begin.template.call
- source: typename
scopes:
- storage.modifier
- source: templated
scopesBegin:
- meta.qualified_type
scopes:
- entity.name.scope-resolution
- source: '::'
scopes:
- punctuation.separator.namespace.access
- punctuation.separator.scope-resolution
- source: type
scopes:
- entity.name.type
scopesEnd:
- meta.qualified_type
- source: '*'
scopes:
- storage.modifier.pointer
- keyword.operator.arithmetic
- source: '>'
scopes:
- punctuation.section.angle-brackets.end.template.call
scopesEnd:
- meta.template.call
- meta.template.call
- source: '::'
scopes:
- punctuation.separator.namespace.access
- punctuation.separator.scope-resolution
- source: type
scopes:
- entity.name.type
scopesEnd:
- meta.qualified_type
- source: value
scopes:
- variable.other.object.declare
- source: ;
scopes:
- punctuation.terminator.statement
- source: int
scopes:
- storage.type.primitive
- storage.type.built-in.primitive
- source: a
scopes:
- variable.other.assignment
- source: '['
scopes:
- punctuation.definition.begin.bracket.square.array.type
- source: ']'
scopes:
- punctuation.definition.end.bracket.square.array.type
- source: '='
scopes:
- keyword.operator.assignment
- source: '{'
scopesBegin:
- meta.block
scopes:
- punctuation.section.block.begin.bracket.curly
- source: '1'
scopes:
- constant.numeric.decimal
- source: ','
scopes:
- punctuation.separator.delimiter.comma
- source: usertype
- source: '2'
scopes:
- entity.name.type.parameter
- source: user_value
- constant.numeric.decimal
- source: ','
scopes:
- variable.parameter
- punctuation.separator.delimiter.comma
- source: '3'
scopes:
- constant.numeric.decimal
- source: '}'
scopes:
- punctuation.section.block.end.bracket.curly
scopesEnd:
- meta.function.definition.parameters
- meta.parameter
- meta.block
- source: ;
scopes:
- punctuation.terminator.statement
- source: function_declaration
scopes:
- entity.name.function.call
- source: (
scopes:
- punctuation.section.arguments.begin.bracket.round.function.call
- source: int
scopes:
- storage.type.primitive
- storage.type.built-in.primitive
- source: '*'
scopes:
- keyword.operator.arithmetic
- source: ','
scopes:
- punctuation.separator.delimiter.comma
- source: ' usertype user_value'
- source: )
scopes:
- punctuation.section.parameters.end.bracket.round
scopesEnd:
- meta.function.definition
- meta.head.function.definition
- punctuation.section.arguments.end.bracket.round.function.call
- source: ;
scopes:
- punctuation.terminator.statement
- source: '}'
scopes:
- punctuation.section.block.end.bracket.curly.function.definition
Loading

0 comments on commit 01ca0d4

Please sign in to comment.