forked from ballerina-platform/ballerina-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a parser test for invalid usage of client decl as stmt
- Loading branch information
Showing
4 changed files
with
214 additions
and
1 deletion.
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
204 changes: 204 additions & 0 deletions
204
...r/ballerina-parser/src/test/resources/declarations/client-decl/client_decl_assert_15.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,204 @@ | ||
{ | ||
"kind": "MODULE_PART", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "LIST", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "FUNCTION_DEFINITION", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "FUNCTION_KEYWORD", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "IDENTIFIER_TOKEN", | ||
"value": "fn" | ||
}, | ||
{ | ||
"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": "LOCAL_VAR_DECL", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "LIST", | ||
"children": [] | ||
}, | ||
{ | ||
"kind": "TYPED_BINDING_PATTERN", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "SINGLETON_TYPE_DESC", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "STRING_LITERAL", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "STRING_LITERAL_TOKEN", | ||
"hasDiagnostics": true, | ||
"value": "http://www.example.com/apis/one.yaml", | ||
"leadingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
}, | ||
{ | ||
"kind": "INVALID_NODE_MINUTIAE", | ||
"invalidNode": { | ||
"kind": "INVALID_TOKEN_MINUTIAE_NODE", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "CLIENT_KEYWORD", | ||
"hasDiagnostics": true, | ||
"diagnostics": [ | ||
"ERROR_QUALIFIER_NOT_ALLOWED" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
], | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "CAPTURE_BINDING_PATTERN", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "IDENTIFIER_TOKEN", | ||
"hasDiagnostics": true, | ||
"value": "foo", | ||
"leadingMinutiae": [ | ||
{ | ||
"kind": "INVALID_NODE_MINUTIAE", | ||
"invalidNode": { | ||
"kind": "INVALID_TOKEN_MINUTIAE_NODE", | ||
"hasDiagnostics": true, | ||
"children": [ | ||
{ | ||
"kind": "AS_KEYWORD", | ||
"hasDiagnostics": true, | ||
"diagnostics": [ | ||
"ERROR_INVALID_TOKEN" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"kind": "WHITESPACE_MINUTIAE", | ||
"value": " " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "SEMICOLON_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "CLOSE_BRACE_TOKEN", | ||
"trailingMinutiae": [ | ||
{ | ||
"kind": "END_OF_LINE_MINUTIAE", | ||
"value": "\n" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "EOF_TOKEN" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
...er/ballerina-parser/src/test/resources/declarations/client-decl/client_decl_source_15.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,3 @@ | ||
function fn() { | ||
client "http://www.example.com/apis/one.yaml" as foo; | ||
} |
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