1. 07 Aug, 2013 1 commit
    • Jose A. Lopes's avatar
      Eliminate Haskell constant for opcode names · d31193c3
      Jose A. Lopes authored
      Modify 'autotools/convert-constants' not to generate the Haskell
      constant that holds all opcode names.  By having Haskell generate the
      Python opcopdes, it becomes impossible to generate this constant due
      to a cyclic dependency.  However, this constant is used only in tests,
      therefore, it can be generated from Template Haskell. This patch also
      updates the test to execute a Python program to fetch the generated
      opcode names instead of relying on the beforementioned constant.
      Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
  2. 05 Mar, 2013 1 commit
  3. 04 Mar, 2013 1 commit
  4. 17 Dec, 2012 1 commit
  5. 30 Nov, 2012 1 commit
  6. 20 Nov, 2012 1 commit
    • Iustin Pop's avatar
      Add custom code for CV_E* constants to convert-constants · 9ba02574
      Iustin Pop authored
      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
      There are three possible fixes:
      - manually separate the CV_ECLUSTER_FOO_STR = "ECLUSTER_FOO" in
      - manually extract the strings in Haskell code
      - change convert-constants to automatically export virtual constants
        for those
      After discussion on IRC, I've taken the latter approach; even though a
      bit hack-ish, it avoids manual work and potential errors.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
  7. 11 Oct, 2012 1 commit
  8. 18 Sep, 2012 1 commit
  9. 03 Sep, 2012 2 commits
  10. 28 Aug, 2012 1 commit
  11. 07 May, 2012 2 commits
    • Iustin Pop's avatar
      Implement reverse mapping of values to names · 79a04823
      Iustin Pop authored
      This adds a bit of dumb mapping of values to names, while trying to be
      safe. This is the best we can do without resorting to parsing or
      interpreting ASTs.
      The difference in the output is:
       -- | Converted from Python list or set ADMINST_ALL
       adminstAll :: [String]
      -adminstAll = ["down", "offline", "up"]
      +adminstAll = [adminstDown, adminstOffline, adminstUp]
      Since for most such values we use strings, we don't gain in type
      safety on the Haskell side. But it makes the output more readable and
      it might open up other opportunities later.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    • Iustin Pop's avatar
      Implement support for multi-module export · 09dc9a02
      Iustin Pop authored
      This add support for exporting constants from multiple modules (as
      opposed to hard-coding constants), and also makes the output more
      readable 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
      Additionally, we export the constants from the luxi module too.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
  12. 13 Jan, 2012 5 commits
  13. 13 Jul, 2011 1 commit
  14. 24 May, 2011 1 commit
    • Iustin Pop's avatar
      Implement conversion of Python constants to Haskell · d99d1e36
      Iustin Pop authored
      With the merge of the repositories, we can now auto-generate the code
      for Haskell constants from the Python code.
      Currently this only handles the basic types (strings and
      integers). Handling containers such as lists and dictionaries is only
      possible if we would use a parser such that we recognise the element
      names. We could extend the convert-constants script if that becomes
      necessary, right now I'm looking at just the simple constants such as
      Iallocator modes, instance states, etc.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>