anuragraghavan / franca

Automatically exported from code.google.com/p/franca
0 stars 0 forks source link

Enumeration with FConstant element #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Franca allows to define enumeration values with all FConstant elements (String, 
Boolean, Integer) although FConstant was designed for Franca contracts. Is this 
a feature or by mistake?

If this is a feature there is a need to have a reference in the enumerator to 
the FConstant.

For DBus transformation only FConstantInteger with positive values are allowed.

Original issue reported on code.google.com by stefan.b...@gmail.com on 5 Feb 2014 at 2:40

GoogleCodeExporter commented 9 years ago
Before 0.9.0, Franca allows to define optional values for FEnumerators, which 
must be of String type. Example:

    enumeration MyEnum03 {
        ENUM01 = "1"
        ENUM02 = "2"
        ENUM03 = "0x03"
    }

Issue 52 (planned for 0.9.0) will mark the string values as deprecated and 
allow positive integer values instead (including other formats like 
hexadecimal). 

Please provide an example for the use case you are referring to by this ticket!

Original comment by klaus.birken@gmail.com on 12 Feb 2014 at 6:47

GoogleCodeExporter commented 9 years ago
This could be an example:

enumeration TestEnum {
  VALUE=d1
}

const Double d1 = 1.0d

This example works without validation issues. But I don't know if d1 is really 
treat as an enum entry

Original comment by stefan.b...@gmail.com on 13 Feb 2014 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by klaus.birken@gmail.com on 14 Feb 2014 at 11:26

GoogleCodeExporter commented 9 years ago
Solved by commit 16f568e.

Original comment by klaus.birken@gmail.com on 14 Feb 2014 at 11:28

GoogleCodeExporter commented 9 years ago
Merged on master.

Original comment by klaus.birken@gmail.com on 19 Feb 2014 at 10:24

GoogleCodeExporter commented 9 years ago

Original comment by klaus.birken@gmail.com on 25 Jan 2015 at 12:31