| 554 | } |
| 555 | |
| 556 | func (e *encoder) builtin(n *semantic.Builtin) Builtin { |
| 557 | switch n { |
| 558 | case semantic.VoidType: |
| 559 | return Builtin_VoidType |
| 560 | case semantic.AnyType: |
| 561 | return Builtin_AnyType |
| 562 | case semantic.StringType: |
| 563 | return Builtin_StringType |
| 564 | case semantic.MessageType: |
| 565 | return Builtin_MessageType |
| 566 | case semantic.BoolType: |
| 567 | return Builtin_BoolType |
| 568 | case semantic.IntType: |
| 569 | return Builtin_IntType |
| 570 | case semantic.UintType: |
| 571 | return Builtin_UintType |
| 572 | case semantic.SizeType: |
| 573 | return Builtin_SizeType |
| 574 | case semantic.CharType: |
| 575 | return Builtin_CharType |
| 576 | case semantic.Int8Type: |
| 577 | return Builtin_Int8Type |
| 578 | case semantic.Uint8Type: |
| 579 | return Builtin_Uint8Type |
| 580 | case semantic.Int16Type: |
| 581 | return Builtin_Int16Type |
| 582 | case semantic.Uint16Type: |
| 583 | return Builtin_Uint16Type |
| 584 | case semantic.Int32Type: |
| 585 | return Builtin_Int32Type |
| 586 | case semantic.Uint32Type: |
| 587 | return Builtin_Uint32Type |
| 588 | case semantic.Int64Type: |
| 589 | return Builtin_Int64Type |
| 590 | case semantic.Uint64Type: |
| 591 | return Builtin_Uint64Type |
| 592 | case semantic.Float32Type: |
| 593 | return Builtin_Float32Type |
| 594 | case semantic.Float64Type: |
| 595 | return Builtin_Float64Type |
| 596 | default: |
| 597 | panic(fmt.Errorf("Unhandled builtin type %v", n)) |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | func (e *encoder) call(n *semantic.Call) (outID uint64) { |
| 602 | e.build(&e.instances.Call, e.maps.Call, n, &outID, func() *Call { |