From c6a30057c3059ec7b579fc00c3da21a2bc1a35f7 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Tue, 19 Jul 2022 23:05:58 +0200 Subject: [PATCH] compiles and works again. --- cabal.project | 2 -- dear-imgui.hs | 2 +- dear-implot.cabal | 6 ++++-- implot | 2 +- src/DearImGui/Plot/Generator/Parser.hs | 8 ++++++++ 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cabal.project b/cabal.project index 8c5ce8d..d46d633 100644 --- a/cabal.project +++ b/cabal.project @@ -2,5 +2,3 @@ packages: *.cabal dear-imgui.hs package dear-implot ghc-options: -Wall -Wcompat -fno-warn-unused-do-bind - --- shared: true diff --git a/dear-imgui.hs b/dear-imgui.hs index 1a27a51..6f42292 160000 --- a/dear-imgui.hs +++ b/dear-imgui.hs @@ -1 +1 @@ -Subproject commit 1a27a51fdecf7ef89ce39346ec423f239207b5a4 +Subproject commit 6f4229271d9f212b90c5a93761642f3995a20472 diff --git a/dear-implot.cabal b/dear-implot.cabal index b6ee796..6f56f51 100644 --- a/dear-implot.cabal +++ b/dear-implot.cabal @@ -53,7 +53,9 @@ library -std=c++11 extra-libraries: stdc++ - HSdear-imgui-1.4.0-inplace + HSdear-imgui-2.0.0-inplace-ghc8.10.7 + extra-bundled-libraries: + HSdear-implot-1.0.0-inplace include-dirs: implot dear-imgui.hs/imgui @@ -63,7 +65,7 @@ library build-depends: base , StateVar , containers - , dear-imgui == 1.4.0 + , dear-imgui == 2.0.0 , inline-c , inline-c-cpp , managed diff --git a/implot b/implot index b47c8ba..7a470b2 160000 --- a/implot +++ b/implot @@ -1 +1 @@ -Subproject commit b47c8bacdbc78bc521691f70666f13924bb522ab +Subproject commit 7a470b2e174584d1d62ea5ebe713fea9c18beb6c diff --git a/src/DearImGui/Plot/Generator/Parser.hs b/src/DearImGui/Plot/Generator/Parser.hs index 853be97..11861a2 100644 --- a/src/DearImGui/Plot/Generator/Parser.hs +++ b/src/DearImGui/Plot/Generator/Parser.hs @@ -99,6 +99,7 @@ plotHeaders = do ( ( Left <$> try ignoreDefine) <|> ( Right <$> enumeration enumNamesAndTypes) <|> ( Left <$> ignoreStruct) + <|> ( Left <$> cppConditionalIgnore) ) ( namedSection "Callbacks" ) @@ -442,6 +443,13 @@ cppConditional = do void $ skipManyTill anySingle ( cppDirective ( \case { "endif" -> Just (); _ -> Nothing } ) ) void $ skipManyTill anySingle ( single EndCPPLine ) +cppConditionalIgnore :: MonadParsec e [Tok] m => m () +cppConditionalIgnore = do + void $ cppDirective ( \case { "ifdef" -> Just (); "ifndef" -> Just (); "if" -> Just (); _ -> Nothing } ) + -- assumes no nesting + void $ skipManyTill anySingle ( cppDirective ( \case { "endif" -> Just (); _ -> Nothing } ) ) + void $ skipManyTill anySingle ( single EndCPPLine ) + ignoreDefine :: MonadParsec e [Tok] m => m () ignoreDefine = do void $ many comment