History | View | Annotate | Download (10 kB)
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 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...
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...
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.
Signed-off-by: Iustin Pop <iustin@google.com>...
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...