ionide / FsAst

http://blog.ctaggart.com/2014/09/generating-f-code-using-its-ast.html
MIT License
48 stars 15 forks source link

Enums #1

Closed ctaggart closed 8 years ago

ctaggart commented 8 years ago

printAstInfo "Enum.fs" now supports prints everything about the enum type:

image

Next up will be creating it from scratch.

ctaggart commented 8 years ago

The input file looks like:

/// enum uint32
type CXErrorCode =
    | CXError_Success = 0u
    | CXError_Failure = 1u
    | CXError_Crashed = 2u
    | CXError_InvalidArguments = 3u
    | CXError_ASTReadError = 4u

Fantomas is formatting it incorrectly like so:

/// enum uint32
type CXErrorCode = 
    | 0u
    | 1u
    | 2u
    | 3u
    | 4u

The from scratch is matching that:

/// enum uinst32
type CXErrorCode = 
    | 0u
    | 1u
    | 2u
    | 3u
    | 4u