From c4a0f51e096c9dd4c0fe12a3ec0d51ad54bc887a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sved=C3=A4ng?= Date: Tue, 27 Feb 2018 14:28:48 +0100 Subject: [PATCH] Handle const args. --- examples/parse_me.h | 2 ++ headerparse/Main.hs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/parse_me.h b/examples/parse_me.h index 41dea874..ed9f8353 100644 --- a/examples/parse_me.h +++ b/examples/parse_me.h @@ -17,3 +17,5 @@ void dah(int *x, float* y); char *blah(int *x, float* y); vector2 *more(vector3* in); + +GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); diff --git a/headerparse/Main.hs b/headerparse/Main.hs index 230ded5c..5d9711dd 100644 --- a/headerparse/Main.hs +++ b/headerparse/Main.hs @@ -68,6 +68,8 @@ parseHeaderFile path src sedCommand = arg :: Parsec.Parsec String () (String, Int) arg = do Parsec.many spaceOrTab + _ <- Parsec.option "" $ do Parsec.string "const" + Parsec.many spaceOrTab argTypeAsString <- Parsec.many1 identifierChar stars1 <- stars Parsec.many1 spaceOrTab