Skip to content

Commit

Permalink
Add VerbatimBlockLineComment API (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCardwell committed Oct 11, 2024
1 parent 6dfc168 commit 7e5e1ef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hs-bindgen-libclang/cbits/doxygen_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ static inline unsigned wrap_TParamCommandComment_getIndex(const CXComment* Comme
return clang_TParamCommandComment_getIndex(*Comment, depth);
}

/**
* Comment type 'CXComment_VerbatimBlockLine'
*/

static inline void wrap_VerbatimBlockLineComment_getText(const CXComment* Comment, CXString* result) {
*result = clang_VerbatimBlockLineComment_getText(*Comment);
}

/**
* Comment type 'CXComment_FullComment'
*/
Expand Down
17 changes: 17 additions & 0 deletions hs-bindgen-libclang/src/HsBindgen/Clang/LowLevel/Doxygen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ module HsBindgen.Clang.LowLevel.Doxygen (
, clang_TParamCommandComment_isParamPositionValid
, clang_TParamCommandComment_getDepth
, clang_TParamCommandComment_getIndex
-- * Comment type 'CXComment_VerbatimBlockLine'
, clang_VerbatimBlockLineComment_getText
-- * Comment type 'CXComment_FullComment'
, clang_FullComment_getAsHTML
, clang_FullComment_getAsXML
Expand Down Expand Up @@ -410,6 +412,21 @@ clang_TParamCommandComment_getIndex comment depth =
onHaskellHeap comment $ \comment' ->
wrap_TParamCommandComment_getIndex comment' depth

{-------------------------------------------------------------------------------
Comment type 'CXComment_VerbatimBlockLine'
-------------------------------------------------------------------------------}

foreign import capi unsafe "doxygen_wrappers.h wrap_VerbatimBlockLineComment_getText"
wrap_VerbatimBlockLineComment_getText :: R CXComment_ -> W CXString_ -> IO ()

-- | Get the text contained in the AST node.
--
-- <https://clang.llvm.org/doxygen/group__CINDEX__COMMENT.html#ga599fad38a1c52917a2458ac10412969f>
clang_VerbatimBlockLineComment_getText :: CXComment -> IO Text
clang_VerbatimBlockLineComment_getText comment =
onHaskellHeap comment $ \comment' ->
preallocate_ $ wrap_VerbatimBlockLineComment_getText comment'

{-------------------------------------------------------------------------------
Comment type 'CXComment_FullComment'
-------------------------------------------------------------------------------}
Expand Down

0 comments on commit 7e5e1ef

Please # to comment.