mirror of
https://github.com/godotengine/godot
synced 2024-09-06 05:23:54 +00:00
Merge pull request #52903 from vnen/gdscript-signal-multiline
This commit is contained in:
commit
3d33815ad7
|
@ -1053,7 +1053,9 @@ GDScriptParser::SignalNode *GDScriptParser::parse_signal() {
|
|||
SignalNode *signal = alloc_node<SignalNode>();
|
||||
signal->identifier = parse_identifier();
|
||||
|
||||
if (match(GDScriptTokenizer::Token::PARENTHESIS_OPEN)) {
|
||||
if (check(GDScriptTokenizer::Token::PARENTHESIS_OPEN)) {
|
||||
push_multiline(true);
|
||||
advance();
|
||||
do {
|
||||
if (check(GDScriptTokenizer::Token::PARENTHESIS_CLOSE)) {
|
||||
// Allow for trailing comma.
|
||||
|
@ -1076,6 +1078,7 @@ GDScriptParser::SignalNode *GDScriptParser::parse_signal() {
|
|||
}
|
||||
} while (match(GDScriptTokenizer::Token::COMMA) && !is_at_end());
|
||||
|
||||
pop_multiline();
|
||||
consume(GDScriptTokenizer::Token::PARENTHESIS_CLOSE, R"*(Expected closing ")" after signal parameters.)*");
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#GDTEST_OK
|
||||
|
||||
# No parentheses.
|
||||
signal a
|
||||
|
||||
# No parameters.
|
||||
signal b()
|
||||
|
||||
# With paramters.
|
||||
signal c(a, b, c)
|
||||
|
||||
# With parameters multiline.
|
||||
signal d(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
)
|
||||
|
||||
func test():
|
||||
print("Ok")
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_OK
|
||||
Ok
|
Loading…
Reference in a new issue