Skip to content

Latest commit

 

History

History
86 lines (74 loc) · 3.59 KB

todo.org

File metadata and controls

86 lines (74 loc) · 3.59 KB

COMPLETED ‘Cleaned’ libclang wrappers

  • State “COMPLETED” from [2020-12-14 Mon 20:08]
  • [X] Instead of simply dropping duplicate enum values generate constants with dropped names.
  • [X] Improve enum name conversion algorithm to also drop CXX in in the name.
  • [X] Completely remove underscores from generated type and function names

Todo list

  • [X] Create fully qualified namespace access names
  • [X] Default operators assignment, constructors, move etc.
  • [X] Follow typedef alias dependencies
  • [X] Wrap alias as type A = B instead of declaring separate object
  • [ ] For all procs that have special arguments (wrappers for default arguments, newly generated args, removed, compressed and so on) should provide additional documentation for such parameters (via @arg{} annotation).
  • [ ] static fields
  • [ ] Convert distinct types (or enums) for ‘special integers’ like sourcetrail ids, and create overloads that use them. Mark original procs as deprecated. Implement overloads as {.inline.} with {.push warning[Deprecated]:off.} in body. Functions that return ‘special integer’ mmust be wrapped as funcNameRaw. Result will be converted to corresponding enum/distincty type
  • [ ] Collect macro constant definitions into enums and use them for overloads from previous step.
  • [ ] Do not create constructors procs for abstract classes
  • [ ] Make closure override opt-in instead of opt-out feature as it largely useless for most libraries.
    • [ ] operator overloading reimplementation is broken and needs partial logic refactoring to fix.
  • [ ] Documentation templating system.
  • [ ] Generate cxxDynCast proc procedures for all derived types (and for all base types to derived ones). For each Dn derived from A create Dn -> A and A -> Bn conversion casts.
    • Can this be adopted for use with nim memory management? When placement new procedures will be generated.
    • Default implementation should check for nullptr results, and raise exception. Need to add ‘raw’ version of the procedure.
  • [ ] Allow completely overwriting output paths for generated files. That is necessary to avoid weird name clases for imports, or fix original file naming that might include dashes, or any other ‘non-standard’ path elements. code:NimImportSpec should also support imports from generated files and those two must be interlinked with each other to support this use case.

Bugs

  • [ ] cxx11 namespace is not correctly collapsed for wrapping methods.
  • [ ] Multiple annonymous enums are converter to the same name
  • [ ] Generated importcpp for nested anonymous enums is incorrect.

Curious how boost::wave and c2nim each handle things like this.

#        if (                                                             \
            defined __USE_GNU                                             \
            && (defined __cplusplus                                       \
                    ? (__cplusplus < 201103L                              \
                       && !defined __GXX_EXPERIMENTAL_CXX0X__)            \
                    : (!defined __STDC_VERSION__                          \
                       || __STDC_VERSION__ < 199901L)))
#            define __GLIBC_USE_DEPRECATED_SCANF 1
#        else
#            define __GLIBC_USE_DEPRECATED_SCANF 0
#        endif

else