Closed Horanol closed 5 years ago
(a == 1)?(b = 1.1;c = 1.2;):(b=2.2) 如上面这个表达式,aviator 报错 Syntax error:expect ':' at 17, current token: [type='Char',lexeme=';',index=17]. Parsing expression: (a == 1)?(b = 1.1;^^
(a == 1)?(b = 1.1;c = 1.2;):(b=2.2)
Syntax error:expect ':' at 17, current token: [type='Char',lexeme=';',index=17]. Parsing expression: (a == 1)?(b = 1.1;^^
这个可能是个 bug,因为多行语句是后面引入的,我分析下。
这样的语法是不支持的,多行语句是作为顶层 statement,不允许再嵌入三元表达式。你可以将嵌套的表达式提取到外面赋值。
(a == 1)?(b = 1.1;c = 1.2;):(b=2.2)
如上面这个表达式,aviator 报错Syntax error:expect ':' at 17, current token: [type='Char',lexeme=';',index=17]. Parsing expression: (a == 1)?(b = 1.1;^^