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

if-выражение не совместимо с ?:, если ставить их в заголовки друг-друга #2337

Closed
SunSerega opened this issue Oct 31, 2020 · 1 comment

Comments

@SunSerega
Copy link
Contributor

http://forum.mmcs.sfedu.ru/t/zamechaniya-i-predlozheniya/143/2039

##

// if внутри if работает
var s1 := if if true then true else false then 'abc' else 'def';

// ?: внутри ?: работает
var s2 := true ? true : false ? 'abc' : 'def';

// Со скобками работает
var s3 := if (true ? true : false) then 'abc' else 'def';

//Ошибка: Встречено '?', а ожидалось then
var s4 := if true ? true : false then 'abc' else 'def';

// Со скобками работает
var s5 := (if true then true else false) ? 'abc' : 'def';

//Ошибка: Встречено '?', а ожидалось ';'
var s6 := if true then true else false ? 'abc' : 'def';
@miks1965
Copy link
Contributor

miks1965 commented Jan 7, 2021

Закрываю. На уровне грамматики с этим проблемы

@miks1965 miks1965 closed this as completed Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants