Skip to content

Commit 01ca0d4

Browse files
committed
better support for initlizers and ranged assignment
1 parent c48cb96 commit 01ca0d4

20 files changed

+2928
-79
lines changed

autogenerated/cpp.embedded.macro.tmLanguage.json

+1-1
Large diffs are not rendered by default.

autogenerated/cpp.tmLanguage.json

+491-8
Large diffs are not rendered by default.

autogenerated/cpp_scopes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ constant.numeric.exponent.hexadecimal.cpp
1515
constant.numeric.hexadecimal.cpp
1616
constant.numeric.octal.cpp
1717
constant.other.placeholder
18+
entity.name.function.call.constructor.cpp
1819
entity.name.function.call.cpp
1920
entity.name.function.call.initializer.cpp
2021
entity.name.function.constructor.cpp

language_examples/#071.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,15 @@ usertype user_value{'A'};
1515
scoped::templated<type> value;
1616
compound<typename templated::type *>::type value;
1717
int a[] = {1,2,3};
18-
void function_declaration(int *, usertype user_value);
18+
function_declaration(int *, usertype user_value);
19+
20+
int main() {
21+
int a;
22+
int b;
23+
usertype user_value;
24+
usertype user_value{'A'};
25+
scoped::templated<type> value;
26+
compound<typename templated::type *>::type value;
27+
int a[] = {1,2,3};
28+
function_declaration(int *, usertype user_value);
29+
}

language_examples/#071.spec.yaml

+267-19
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@
4545
- source: ;
4646
scopes:
4747
- punctuation.terminator.statement
48-
- source: ' usertype user_value'
48+
- source: usertype
49+
scopes:
50+
- meta.qualified_type
51+
- entity.name.type
52+
- source: user_value
53+
scopes:
54+
- entity.name.function.call.constructor
4955
- source: '{'
5056
scopesBegin:
5157
- meta.block
@@ -74,7 +80,15 @@
7480
scopes:
7581
- storage.type.primitive
7682
- storage.type.built-in.primitive
77-
- source: ' a[] '
83+
- source: a
84+
scopes:
85+
- variable.other.assignment
86+
- source: '['
87+
scopes:
88+
- punctuation.definition.begin.bracket.square.array.type
89+
- source: ']'
90+
scopes:
91+
- punctuation.definition.end.bracket.square.array.type
7892
- source: '='
7993
scopes:
8094
- keyword.operator.assignment
@@ -221,7 +235,13 @@
221235
- source: ;
222236
scopes:
223237
- punctuation.terminator.statement
224-
- source: usertype user_value
238+
- source: usertype
239+
scopes:
240+
- meta.qualified_type
241+
- entity.name.type
242+
- source: user_value
243+
scopes:
244+
- entity.name.function.call.constructor
225245
- source: '{'
226246
scopesBegin:
227247
- meta.block
@@ -312,7 +332,15 @@
312332
scopes:
313333
- storage.type.primitive
314334
- storage.type.built-in.primitive
315-
- source: ' a[] '
335+
- source: a
336+
scopes:
337+
- variable.other.assignment
338+
- source: '['
339+
scopes:
340+
- punctuation.definition.begin.bracket.square.array.type
341+
- source: ']'
342+
scopes:
343+
- punctuation.definition.end.bracket.square.array.type
316344
- source: '='
317345
scopes:
318346
- keyword.operator.assignment
@@ -344,49 +372,269 @@
344372
- source: ;
345373
scopes:
346374
- punctuation.terminator.statement
347-
- source: void
375+
- source: function_declaration
376+
scopes:
377+
- entity.name.function.call
378+
- source: (
379+
scopes:
380+
- punctuation.section.arguments.begin.bracket.round.function.call
381+
- source: int
382+
scopes:
383+
- storage.type.primitive
384+
- storage.type.built-in.primitive
385+
- source: '*'
386+
scopes:
387+
- keyword.operator.arithmetic
388+
- source: ','
389+
scopes:
390+
- punctuation.separator.delimiter.comma
391+
- source: ' usertype user_value'
392+
- source: )
393+
scopes:
394+
- punctuation.section.arguments.end.bracket.round.function.call
395+
- source: ;
396+
scopes:
397+
- punctuation.terminator.statement
398+
- source: int
348399
scopesBegin:
349400
- meta.function.definition
350401
scopes:
351402
- meta.qualified_type
352403
- storage.type.primitive
353404
- storage.type.built-in.primitive
354-
- source: function_declaration
405+
- source: main
355406
scopesBegin:
356407
- meta.head.function.definition
357408
scopes:
358409
- entity.name.function.definition
359410
- source: (
360411
scopes:
361412
- punctuation.section.parameters.begin.bracket.round
413+
- source: )
414+
scopes:
415+
- punctuation.section.parameters.end.bracket.round
416+
- source: '{'
417+
scopes:
418+
- punctuation.section.block.begin.bracket.curly.function.definition
419+
scopesEnd:
420+
- meta.head.function.definition
362421
- source: int
363422
scopesBegin:
364-
- meta.function.definition.parameters
365-
- meta.parameter
423+
- meta.body.function.definition
366424
scopes:
425+
- meta.qualified_type
367426
- storage.type.primitive
368427
- storage.type.built-in.primitive
428+
- source: a
429+
scopes:
430+
- variable.other.object.declare
431+
- source: ;
432+
scopes:
433+
- punctuation.terminator.statement
434+
- source: int
435+
scopes:
436+
- meta.qualified_type
437+
- storage.type.primitive
438+
- storage.type.built-in.primitive
439+
- source: b
440+
scopes:
441+
- variable.other.object.declare
442+
- source: ;
443+
scopes:
444+
- punctuation.terminator.statement
445+
- source: usertype
446+
scopes:
447+
- meta.qualified_type
448+
- entity.name.type
449+
- source: user_value
450+
scopes:
451+
- variable.other.object.declare
452+
- source: ;
453+
scopes:
454+
- punctuation.terminator.statement
455+
- source: usertype
456+
scopes:
457+
- meta.qualified_type
458+
- entity.name.type
459+
- source: user_value
460+
scopes:
461+
- entity.name.function.call.constructor
462+
- source: '{'
463+
scopesBegin:
464+
- meta.block
465+
scopes:
466+
- punctuation.section.block.begin.bracket.curly
467+
- source: ''''
468+
scopesBegin:
469+
- string.quoted.single
470+
scopes:
471+
- punctuation.definition.string.begin
472+
- source: A
473+
- source: ''''
474+
scopes:
475+
- punctuation.definition.string.end
476+
scopesEnd:
477+
- string.quoted.single
478+
- source: '}'
479+
scopes:
480+
- punctuation.section.block.end.bracket.curly
481+
scopesEnd:
482+
- meta.block
483+
- source: ;
484+
scopes:
485+
- punctuation.terminator.statement
486+
- source: scoped
487+
scopesBegin:
488+
- meta.qualified_type
489+
scopes:
490+
- entity.name.scope-resolution
491+
- source: '::'
492+
scopes:
493+
- punctuation.separator.namespace.access
494+
- punctuation.separator.scope-resolution
495+
- source: templated
496+
scopes:
497+
- entity.name.type
498+
- source: <
499+
scopesBegin:
500+
- meta.template.call
501+
scopes:
502+
- punctuation.section.angle-brackets.begin.template.call
503+
- source: type
504+
scopes:
505+
- meta.qualified_type
506+
- entity.name.type
507+
- source: '>'
508+
scopes:
509+
- punctuation.section.angle-brackets.end.template.call
510+
scopesEnd:
511+
- meta.qualified_type
512+
- meta.template.call
513+
- source: value
514+
scopes:
515+
- variable.other.object.declare
516+
- source: ;
517+
scopes:
518+
- punctuation.terminator.statement
519+
- source: compound
520+
scopesBegin:
521+
- meta.qualified_type
522+
scopes:
523+
- entity.name.scope-resolution
524+
- source: <
525+
scopesBegin:
526+
- meta.template.call
527+
- meta.template.call
528+
scopes:
529+
- punctuation.section.angle-brackets.begin.template.call
530+
- source: typename
531+
scopes:
532+
- storage.modifier
533+
- source: templated
534+
scopesBegin:
535+
- meta.qualified_type
536+
scopes:
537+
- entity.name.scope-resolution
538+
- source: '::'
539+
scopes:
540+
- punctuation.separator.namespace.access
541+
- punctuation.separator.scope-resolution
542+
- source: type
543+
scopes:
544+
- entity.name.type
545+
scopesEnd:
546+
- meta.qualified_type
369547
- source: '*'
370548
scopes:
371-
- storage.modifier.pointer
549+
- keyword.operator.arithmetic
550+
- source: '>'
551+
scopes:
552+
- punctuation.section.angle-brackets.end.template.call
553+
scopesEnd:
554+
- meta.template.call
555+
- meta.template.call
556+
- source: '::'
557+
scopes:
558+
- punctuation.separator.namespace.access
559+
- punctuation.separator.scope-resolution
560+
- source: type
561+
scopes:
562+
- entity.name.type
563+
scopesEnd:
564+
- meta.qualified_type
565+
- source: value
566+
scopes:
567+
- variable.other.object.declare
568+
- source: ;
569+
scopes:
570+
- punctuation.terminator.statement
571+
- source: int
572+
scopes:
573+
- storage.type.primitive
574+
- storage.type.built-in.primitive
575+
- source: a
576+
scopes:
577+
- variable.other.assignment
578+
- source: '['
579+
scopes:
580+
- punctuation.definition.begin.bracket.square.array.type
581+
- source: ']'
582+
scopes:
583+
- punctuation.definition.end.bracket.square.array.type
584+
- source: '='
585+
scopes:
586+
- keyword.operator.assignment
587+
- source: '{'
588+
scopesBegin:
589+
- meta.block
590+
scopes:
591+
- punctuation.section.block.begin.bracket.curly
592+
- source: '1'
593+
scopes:
594+
- constant.numeric.decimal
372595
- source: ','
373596
scopes:
374597
- punctuation.separator.delimiter.comma
375-
- source: usertype
598+
- source: '2'
376599
scopes:
377-
- entity.name.type.parameter
378-
- source: user_value
600+
- constant.numeric.decimal
601+
- source: ','
379602
scopes:
380-
- variable.parameter
603+
- punctuation.separator.delimiter.comma
604+
- source: '3'
605+
scopes:
606+
- constant.numeric.decimal
607+
- source: '}'
608+
scopes:
609+
- punctuation.section.block.end.bracket.curly
381610
scopesEnd:
382-
- meta.function.definition.parameters
383-
- meta.parameter
611+
- meta.block
612+
- source: ;
613+
scopes:
614+
- punctuation.terminator.statement
615+
- source: function_declaration
616+
scopes:
617+
- entity.name.function.call
618+
- source: (
619+
scopes:
620+
- punctuation.section.arguments.begin.bracket.round.function.call
621+
- source: int
622+
scopes:
623+
- storage.type.primitive
624+
- storage.type.built-in.primitive
625+
- source: '*'
626+
scopes:
627+
- keyword.operator.arithmetic
628+
- source: ','
629+
scopes:
630+
- punctuation.separator.delimiter.comma
631+
- source: ' usertype user_value'
384632
- source: )
385633
scopes:
386-
- punctuation.section.parameters.end.bracket.round
387-
scopesEnd:
388-
- meta.function.definition
389-
- meta.head.function.definition
634+
- punctuation.section.arguments.end.bracket.round.function.call
390635
- source: ;
391636
scopes:
392637
- punctuation.terminator.statement
638+
- source: '}'
639+
scopes:
640+
- punctuation.section.block.end.bracket.curly.function.definition

0 commit comments

Comments
 (0)