44 lines
No EOL
1,000 B
Text
44 lines
No EOL
1,000 B
Text
// concrete:
|
|
// | File
|
|
// | IfStatement
|
|
// | ConditionalExpression
|
|
// | If:'"if"'
|
|
// | LiteralExpression
|
|
// | True:'"true"'
|
|
// | Block
|
|
// | LeftBrace:'"{"'
|
|
// | ExpressionStatement
|
|
// | LiteralExpression
|
|
// | String:'"\"discarded\""'
|
|
// | Semicolon:'";"'
|
|
// | ExpressionStatement
|
|
// | LiteralExpression
|
|
// | Number:'"23"'
|
|
// | RightBrace:'"}"'
|
|
// | Else:'"else"'
|
|
// | Block
|
|
// | LeftBrace:'"{"'
|
|
// | ExpressionStatement
|
|
// | LiteralExpression
|
|
// | Number:'"45"'
|
|
// | RightBrace:'"}"'
|
|
//
|
|
if true { "discarded"; 23 } else { 45 }
|
|
|
|
// Here come some type probes!
|
|
// (type of the condition)
|
|
// type: 667 bool
|
|
//
|
|
// (the discarded expression)
|
|
// type: 674 string
|
|
//
|
|
// (the "then" clause)
|
|
// type: 686 f64
|
|
// type: 689 f64
|
|
//
|
|
// (the "else" clause)
|
|
// type: 696 f64
|
|
// type: 699 f64
|
|
//
|
|
// (the overall expression)
|
|
// type: 664 f64 |