Skip to content
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

Ждать в одном стейтменте #151

Merged
merged 5 commits into from
Nov 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/antlr/BSLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ statement
)
| SEMICOLON
;
assignment : lValue preprocessor* ASSIGN (preprocessor* expression)?;
assignment : lValue preprocessor* ASSIGN (preprocessor* expression);
callParamList : callParam (COMMA callParam)*;
callParam : expression?;
expression : member (preprocessor* operation preprocessor* member preprocessor*)*;
Expand All @@ -242,7 +242,7 @@ member
: unaryModifier?
(
constValue
| complexIdentifier
| WAIT_KEYWORD? complexIdentifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вроде такая штука позволит сделать Ждать А.А, без вызова метода на конце. а такое нельзя

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вроде такая штука позволит сделать Ждать А.А, без вызова метода на конце. а такое нельзя

проверили, можно

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно, отчего же нельзя. Ждать работает как Возврат <Выражение>, т.е. просто принимает некий аргумент типа Обещание. Можно смело напихать обещания в структуру структур структур и ждать их через несколько точек

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, что Ждать (Обещание) тоже возможен синтаксически, т.к. обещание в скобках это все равно обещание. Так же, как Возврат ("Что в скобках, что без скобок, разницы нет, т.к. это экспрешшен")

| (( LPAREN expression RPAREN ) modifier*)
| (WAIT_KEYWORD (IDENTIFIER | globalMethodCall))
);
Expand Down