(n, ctx)
| 307 | } |
| 308 | |
| 309 | static ConvertAssignmentExpression (n, ctx) { |
| 310 | if (n.operator !== '=') throw new Error(`Weird assigment operator ${n.operator}`) |
| 311 | if (n.left.type !== 'Identifier') throw new Error('Can only assign to variables') |
| 312 | |
| 313 | return { |
| 314 | type: 'variables_set', |
| 315 | fields: { VAR: { id: n.left.name } }, |
| 316 | inputs: { |
| 317 | VALUE: { block: convert(n.right, { ...ctx, context: 'value' }) }, |
| 318 | }, |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | static ConvertBinaryExpression (n, ctx) { |
| 323 | const [type, op] = ({ |