anz-bank / sysl-go

Communication library used by SYSL-generated code written in Go.
Apache License 2.0
10 stars 14 forks source link

codegen transforms don't handle sysl "double" type #107

Closed ghost closed 4 years ago

ghost commented 4 years ago

the sysl "double" type gets output directly to the types.go file (or any of them) without a typedef. type double float64 needs to be generated

tiagralee commented 4 years ago

@anz-gordonj7 I had a look in sysl transformation, the type mapping are as below:

          "DECIMAL" => "double"
          "INT" => "int64"
          "FLOAT" => "float64"

I did a test, the current transform is from:

    !type TestDoubleType:
        price <: decimal
        priceFloat <: float

to

type TestDoubleType struct {
    Price       double  `json:"price"`
    PriceFloat  float64 `json:"priceFloat"`
}

Can you use decimal or float instead or we need to add a rule for double? Looks like double is not a sysl type from the intellisense. image

ghost commented 4 years ago

yeah, double is not a sysl type, so I guess the actual problem is the code that generated the sysl needs to be fixed, lets close this