-
Notifications
You must be signed in to change notification settings - Fork 97
[Version 9.0] Feature support for attributes on local functions #1466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
692c320
Add support for attributes and extern on local functions
RexJaeschke 5574353
restore parens
RexJaeschke 1d2161e
add new text re local functions
RexJaeschke 8fbdc65
fix md
RexJaeschke 33a1f03
Small wording edits
BillWagner 61bd38c
Apply suggestions from code review
BillWagner 3e9e2b7
restore example (#1548)
RexJaeschke 546e37f
Address remaining issues.
BillWagner c31e41d
remove note.
BillWagner b5f89a5
Found additional locations to update
BillWagner bc9ef6c
Apply suggestion from @BillWagner
BillWagner f1326aa
Add lambda example
BillWagner 7ded0f5
Add sample for PR#1466
Nigel-Ecma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...GrammarTesting/Tests/Parsing/Samples/v9/Attributes on Local Functions/ReadMe.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Sample: Attributes on Local Functions | ||
|
|
||
| This is taken from §23.5.6.4 The CallerMemberName attribute |
Empty file.
Empty file.
78 changes: 78 additions & 0 deletions
78
...esting/Tests/Parsing/Samples/v9/Attributes on Local Functions/Reference/sample.tokens.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| [@0,0:4='using',<'using'>,1:0] | ||
| [@1,6:11='System',<Simple_Identifier>,1:6] | ||
| [@2,12:12=';',<';'>,1:12] | ||
| [@3,15:19='class',<'class'>,3:0] | ||
| [@4,21:27='Program',<Simple_Identifier>,3:6] | ||
| [@5,29:29='{',<'{'>,4:0] | ||
| [@6,35:40='static',<'static'>,5:4] | ||
| [@7,42:45='void',<'void'>,5:11] | ||
| [@8,47:50='Main',<Simple_Identifier>,5:16] | ||
| [@9,51:51='(',<'('>,5:20] | ||
| [@10,52:52=')',<')'>,5:21] | ||
| [@11,58:58='{',<'{'>,6:4] | ||
| [@12,68:69='F1',<Simple_Identifier>,7:8] | ||
| [@13,70:70='(',<'('>,7:10] | ||
| [@14,71:71=')',<')'>,7:11] | ||
| [@15,72:72=';',<';'>,7:12] | ||
| [@16,83:86='void',<'void'>,9:8] | ||
| [@17,88:89='F1',<Simple_Identifier>,9:13] | ||
| [@18,90:90='(',<'('>,9:15] | ||
| [@19,91:91='[',<'['>,9:16] | ||
| [@20,92:107='CallerMemberName',<Simple_Identifier>,9:17] | ||
| [@21,108:108=']',<']'>,9:33] | ||
| [@22,110:115='string',<'string'>,9:35] | ||
| [@23,116:116='?',<'?'>,9:41] | ||
| [@24,118:121='name',<Simple_Identifier>,9:43] | ||
| [@25,123:123='=',<'='>,9:48] | ||
| [@26,125:128='null',<'null'>,9:50] | ||
| [@27,129:129=')',<')'>,9:54] | ||
| [@28,139:139='{',<'{'>,10:8] | ||
| [@29,153:159='Console',<Simple_Identifier>,11:12] | ||
| [@30,160:160='.',<'.'>,11:19] | ||
| [@31,161:169='WriteLine',<Simple_Identifier>,11:20] | ||
| [@32,170:170='(',<'('>,11:29] | ||
| [@33,171:172='〔$"〕',<Interpolated_Regular_String_Start>,11:30] | ||
| [@34,173:188='〔F1 MemberName: |〕',<Interpolated_Regular_String_Mid>,11:32] | ||
| [@35,189:189='{',<'{'>,11:48] | ||
| [@36,190:193='name',<Simple_Identifier>,11:49] | ||
| [@37,194:194='}',<'}'>,11:53] | ||
| [@38,195:195='〔|〕',<Interpolated_Regular_String_Mid>,11:54] | ||
| [@39,196:196='〔"〕',<Interpolated_Regular_String_End>,11:55] | ||
| [@40,197:197=')',<')'>,11:56] | ||
| [@41,198:198=';',<';'>,11:57] | ||
| [@42,212:213='F2',<Simple_Identifier>,12:12] | ||
| [@43,214:214='(',<'('>,12:14] | ||
| [@44,215:215=')',<')'>,12:15] | ||
| [@45,216:216=';',<';'>,12:16] | ||
| [@46,226:226='}',<'}'>,13:8] | ||
| [@47,237:242='static',<'static'>,15:8] | ||
| [@48,244:247='void',<'void'>,15:15] | ||
| [@49,249:250='F2',<Simple_Identifier>,15:20] | ||
| [@50,251:251='(',<'('>,15:22] | ||
| [@51,252:252='[',<'['>,15:23] | ||
| [@52,253:268='CallerMemberName',<Simple_Identifier>,15:24] | ||
| [@53,269:269=']',<']'>,15:40] | ||
| [@54,271:276='string',<'string'>,15:42] | ||
| [@55,277:277='?',<'?'>,15:48] | ||
| [@56,279:282='name',<Simple_Identifier>,15:50] | ||
| [@57,284:284='=',<'='>,15:55] | ||
| [@58,286:289='null',<'null'>,15:57] | ||
| [@59,290:290=')',<')'>,15:61] | ||
| [@60,300:300='{',<'{'>,16:8] | ||
| [@61,314:320='Console',<Simple_Identifier>,17:12] | ||
| [@62,321:321='.',<'.'>,17:19] | ||
| [@63,322:330='WriteLine',<Simple_Identifier>,17:20] | ||
| [@64,331:331='(',<'('>,17:29] | ||
| [@65,332:333='〔$"〕',<Interpolated_Regular_String_Start>,17:30] | ||
| [@66,334:349='〔F2 MemberName: |〕',<Interpolated_Regular_String_Mid>,17:32] | ||
| [@67,350:350='{',<'{'>,17:48] | ||
| [@68,351:354='name',<Simple_Identifier>,17:49] | ||
| [@69,355:355='}',<'}'>,17:53] | ||
| [@70,356:356='〔|〕',<Interpolated_Regular_String_Mid>,17:54] | ||
| [@71,357:357='〔"〕',<Interpolated_Regular_String_End>,17:55] | ||
| [@72,358:358=')',<')'>,17:56] | ||
| [@73,359:359=';',<';'>,17:57] | ||
| [@74,369:369='}',<'}'>,18:8] | ||
| [@75,375:375='}',<'}'>,19:4] | ||
| [@76,377:377='}',<'}'>,20:0] | ||
| [@77,378:377='<EOF>',<EOF>,20:1] |
1 change: 1 addition & 0 deletions
1
...ting/Tests/Parsing/Samples/v9/Attributes on Local Functions/Reference/sample.tree.red.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| (prog (compilation_unit (using_directive (using_namespace_directive using (namespace_name (identifier System)) ;)) (namespace_member_declaration (class_declaration class (identifier Program) (class_body { (class_member_declaration (method_declaration (method_modifiers (ref_method_modifier static)) (return_type void) (method_header (member_name (identifier Main)) ( )) (method_body (block { (statement_list (statement (expression_statement (statement_expression (invocation_expression (primary_expression (identifier F1)) ( ))) ;)) (statement (local_function_declaration (return_type void) (local_function_header (identifier F1) ( (parameter_list (fixed_parameter (attributes (attribute_section [ (attribute_list (identifier CallerMemberName)) ])) (type (nullable_reference_type (non_nullable_reference_type (class_type string)) (nullable_type_annotation ?))) (identifier name) (default_argument = (expression (null_literal null))))) )) (local_function_body (block { (statement_list (statement (expression_statement (statement_expression (invocation_expression (primary_expression (member_access (primary_expression (identifier Console)) . (identifier WriteLine))) ( (argument_list (interpolated_regular_string_expression 〔$"〕 〔F1 MemberName: |〕 { (regular_interpolation (identifier name)) } 〔|〕 〔"〕)) ))) ;)) (statement (expression_statement (statement_expression (invocation_expression (primary_expression (identifier F2)) ( ))) ;))) })))) (statement (local_function_declaration (local_function_modifier (ref_local_function_modifier static)) (return_type void) (local_function_header (identifier F2) ( (parameter_list (fixed_parameter (attributes (attribute_section [ (attribute_list (identifier CallerMemberName)) ])) (type (nullable_reference_type (non_nullable_reference_type (class_type string)) (nullable_type_annotation ?))) (identifier name) (default_argument = (expression (null_literal null))))) )) (local_function_body (block { (statement_list (expression_statement (statement_expression (invocation_expression (primary_expression (member_access (primary_expression (identifier Console)) . (identifier WriteLine))) ( (argument_list (interpolated_regular_string_expression 〔$"〕 〔F2 MemberName: |〕 { (regular_interpolation (identifier name)) } 〔|〕 〔"〕)) ))) ;)) }))))) })))) }))))) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we easily extend the example to include a lambda? Presumably this would do the trick, if we've got
Actiondeclared elsewhere:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in the next commit.