History | View | Annotate | Download (10.8 kB)
convert-constants: generate better Haddock markup
Currently the Python source constants are used as-is, which is notnice on the eyes (especially for unqualified names, it was hard toseparate them visually).
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix convert-constants handling of booleans
It turns out that, in Python, booleans are also integers. So they fallunder the “isinstance(value, int)” case, resulting in all enable*constants being integers in Haskell, which is not nice, even thoughwe're not using them directly today....
Export jstore constants as well to Constants.hs
This single constant could be as well moved to constants.py. For now Ichoose to just export the module as well.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Enable equivalence checks of opcode list
This patch enhances the opcode list checks - instead of spawning aPython interpreter to display the opcode list, we export it staticallyin Constants.hs via a slight convert-constants change.
Furthermore, since we now have opcode parity, we enable full opcode...
Add custom code for CV_E* constants to convert-constants
Currently, the cluster verify errors are defined as follows:
CV_ECLUSTER_FOO = (TCLUSTER, "ECLUSTER_FOO", "description")
This means there's no standalone name for the string "ECLUSTER_FOO",which makes it hard to derive automatically a type for this union in...
Enable conversion of errors constants
These will be needed for the serialisation of errors.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Use autoconf-based paths from Haskell instead of constants
Future changes will change Path.hs to use an environment variable.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Extend convert-constants support for dicts
This enhances convert-constants to not flatten dicts completely, butalso generate a so-called association list for them.
This allows either direct use of the 'lookup' function, or (forperformance) conversion to Data.Map and optimised lookup later....
Enhance convert-constants list generation
While looking at the hypervisor types in Constants.hs, I saw that the'hyperTypes' list is using strings instead of names. This is due tothe fact that we require the entire elements in the list to beidentified (homogeneous lists), but the string "xen-pvm" is declared...
convert-constants: also export qlang.py constants
Since these will be needed for Haskell's implementation of query2.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Implement support for multi-module export
This add support for exporting constants from multiple modules (asopposed to hard-coding constants), and also makes the output morereadable by skipping things we know for sure we don't want to convert(as opposed to things we would like to but don't know how to...
Implement reverse mapping of values to names
This adds a bit of dumb mapping of values to names, while trying to besafe. This is the best we can do without resorting to parsing orinterpreting ASTs.
The difference in the output is:
-- | Converted from Python list or set ADMINST_ALL...
Add support for RE patterns to convert constants
This is a trivial conversion.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add support for lists/frozensets in convert-constants
Unfortunately, we only support lists of simple types, and not evenlists of tuples. If we actually needed those, it would be possible toimplement them, with a bit more complexity in the converter.
Add support for tuples in convert-constants
More improvements to convert-constants
This prepares for tuple and other conversions.
Improve convert-constants to handle dictionaries
The two main drawbacks for convert-constants are the fact that itcan't handle sets/frozensets (mainly due to the fact that I don't knowhow useful this would be to the Haskell code) and that it cannotexport dictionaries....
Fix some issues in htools apidoc generation
First, auto-generated files were not processed if HsColour thus the'source' link in Haddock documentation was dangling.
Second, we document the original Python constant name in theGaneti.Constants source, so that it's easily retrievable (as opposed...
Implement conversion of Python constants to Haskell
With the merge of the repositories, we can now auto-generate the codefor Haskell constants from the Python code.
Currently this only handles the basic types (strings andintegers). Handling containers such as lists and dictionaries is only...