-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41131 from rdulmina/master
Fix `map` keyword using as an identifier when it is followed by `<`
- Loading branch information
Showing
6 changed files
with
268 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 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
247 changes: 247 additions & 0 deletions
247
...r/src/test/resources/expressions/qualified-identifier/qualified_identifier_assert_09.json
This file contains 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,247 @@ | ||
{ | ||
"kind": "FUNCTION_DEFINITION", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "LIST", | ||
"children": [ | ||
{ | ||
"kind": "PUBLIC_KEYWORD", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "FUNCTION_KEYWORD", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "IDENTIFIER_TOKEN", | ||
"value": "main" | ||
}, | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "FUNCTION_SIGNATURE", | ||
"children": [ | ||
{ | ||
"kind": "OPEN_PAREN_TOKEN" | ||
}, | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "CLOSE_PAREN_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "FUNCTION_BODY_BLOCK", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "OPEN_BRACE_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "LIST", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "INVALID_EXPRESSION_STATEMENT", | ||
"hasDiagnostics": true, | ||
"diagnostics": [ | ||
"ERROR_INVALID_EXPRESSION_STATEMENT" | ||
], | ||
"children": [ | ||
{ | ||
"kind": "QUALIFIED_NAME_REFERENCE", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "IDENTIFIER_TOKEN", | ||
"value": "module1", | ||
"leadingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "COLON_TOKEN", | ||
"hasDiagnostics": true, | ||
"diagnostics": [ | ||
"ERROR_INTERVENING_WHITESPACES_ARE_NOT_ALLOWED" | ||
], | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "IDENTIFIER_TOKEN", | ||
"isMissing": true, | ||
"hasDiagnostics": true, | ||
"diagnostics": [ | ||
"ERROR_MISSING_IDENTIFIER" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "SEMICOLON_TOKEN", | ||
"isMissing": true, | ||
"hasDiagnostics": true, | ||
"diagnostics": [ | ||
"ERROR_MISSING_SEMICOLON_TOKEN" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "LOCAL_VAR_DECL", | ||
"children": [ | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "TYPED_BINDING_PATTERN", | ||
"children": [ | ||
{ | ||
"kind": "MAP_TYPE_DESC", | ||
"children": [ | ||
{ | ||
"kind": "MAP_KEYWORD", | ||
"leadingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
}, | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "TYPE_PARAMETER", | ||
"children": [ | ||
{ | ||
"kind": "LT_TOKEN" | ||
}, | ||
{ | ||
"kind": "INT_TYPE_DESC", | ||
"children": [ | ||
{ | ||
"kind": "INT_KEYWORD" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "GT_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "CAPTURE_BINDING_PATTERN", | ||
"children": [ | ||
{ | ||
"kind": "IDENTIFIER_TOKEN", | ||
"value": "m", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "EQUAL_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "MAPPING_CONSTRUCTOR", | ||
"children": [ | ||
{ | ||
"kind": "OPEN_BRACE_TOKEN" | ||
}, | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "CLOSE_BRACE_TOKEN" | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "SEMICOLON_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "CLOSE_BRACE_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...er/src/test/resources/expressions/qualified-identifier/qualified_identifier_source_09.bal
This file contains 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,5 @@ | ||
public function main() { | ||
module1: | ||
|
||
map<int> m = {}; | ||
} |
This file contains 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