Skip to content

Commit

Permalink
Add VerbatimLineComment API (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCardwell committed Oct 11, 2024
1 parent 7e5e1ef commit ce46731
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 @@ -135,6 +135,14 @@ static inline void wrap_VerbatimBlockLineComment_getText(const CXComment* Commen
*result = clang_VerbatimBlockLineComment_getText(*Comment);
}

/**
* Comment type 'CXComment_VerbatimLine'
*/

static inline void wrap_VerbatimLineComment_getText(const CXComment* Comment, CXString* result) {
*result = clang_VerbatimLineComment_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 @@ -42,6 +42,8 @@ module HsBindgen.Clang.LowLevel.Doxygen (
, clang_TParamCommandComment_getIndex
-- * Comment type 'CXComment_VerbatimBlockLine'
, clang_VerbatimBlockLineComment_getText
-- * Comment type 'CXComment_VerbatimLine'
, clang_VerbatimLineComment_getText
-- * Comment type 'CXComment_FullComment'
, clang_FullComment_getAsHTML
, clang_FullComment_getAsXML
Expand Down Expand Up @@ -427,6 +429,21 @@ clang_VerbatimBlockLineComment_getText comment =
onHaskellHeap comment $ \comment' ->
preallocate_ $ wrap_VerbatimBlockLineComment_getText comment'

{-------------------------------------------------------------------------------
Comment type 'CXComment_VerbatimLine'
-------------------------------------------------------------------------------}

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

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

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

0 comments on commit ce46731

Please sign in to comment.