stdlib_gen.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Code generated by ecal/stdlib/generate; DO NOT EDIT.
  2. package stdlib
  3. import (
  4. "fmt"
  5. "math"
  6. "reflect"
  7. )
  8. /*
  9. genStdlib contains all generated stdlib constructs.
  10. */
  11. var genStdlib = map[interface{}]interface{}{
  12. "math-synopsis": "Mathematics-related constants and functions",
  13. "math-const": mathConstMap,
  14. "math-func": mathFuncMap,
  15. "math-func-doc": mathFuncDocMap,
  16. }
  17. /*
  18. mathConstMap contains the mapping of stdlib math constants.
  19. */
  20. var mathConstMap = map[interface{}]interface{}{
  21. "E": float64(math.E),
  22. "Phi": float64(math.Phi),
  23. "Pi": float64(math.Pi),
  24. }
  25. /*
  26. mathFuncDocMap contains the documentation of stdlib math functions.
  27. */
  28. var mathFuncDocMap = map[interface{}]interface{}{
  29. "Inf": "Function: Inf",
  30. "IsInf": "Function: IsInf",
  31. "IsNaN": "Function: IsNaN",
  32. }
  33. /*
  34. mathFuncMap contains the mapping of stdlib math functions.
  35. */
  36. var mathFuncMap = map[interface{}]interface{}{
  37. "Inf": &ECALFunctionAdapter{reflect.ValueOf(math.Inf), fmt.Sprint(mathFuncDocMap["Inf"])},
  38. "IsInf": &ECALFunctionAdapter{reflect.ValueOf(math.IsInf), fmt.Sprint(mathFuncDocMap["IsInf"])},
  39. "IsNaN": &ECALFunctionAdapter{reflect.ValueOf(math.IsNaN), fmt.Sprint(mathFuncDocMap["IsNaN"])},
  40. }
  41. // Dummy statement to prevent declared and not used errors
  42. var Dummy = fmt.Sprint(reflect.ValueOf(fmt.Sprint))