Add `cmd/genop` program to generate operator functions in `interp/op.go`. For each operator, determine its type, handle argument types conversion if necessary. Arithmetic operators are added for now. Assign and comparison operators coming in a next commit.
14 lines
115 B
Go
14 lines
115 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
var d = 2 * time.Second
|
|
|
|
func main() { fmt.Println(d) }
|
|
|
|
// Output:
|
|
// 2s
|