diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2019-01-22 11:14:32 -0600 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2019-01-22 11:14:32 -0600 |
| commit | bf685d1dfc356f41e07e8c42e28969381452df7e (patch) | |
| tree | 1b873f7ff98b793c0a3c3c12e75e79b41be4604d | |
| parent | f9d0514ad453077f13073562f393921fe49c8ec2 (diff) | |
| download | nimterop-bf685d1dfc356f41e07e8c42e28969381452df7e.tar.gz nimterop-bf685d1dfc356f41e07e8c42e28969381452df7e.zip | |
Fix #58
| -rw-r--r-- | nimterop/grammar.nim | 7 | ||||
| -rw-r--r-- | tests/include/test.c | 10 | ||||
| -rw-r--r-- | tests/include/test.h | 6 | ||||
| -rw-r--r-- | tests/tnimterop_c.nim | 5 |
4 files changed, 26 insertions, 2 deletions
diff --git a/nimterop/grammar.nim b/nimterop/grammar.nim index 28b08d1..9a434fe 100644 --- a/nimterop/grammar.nim +++ b/nimterop/grammar.nim @@ -305,7 +305,10 @@ proc initGrammar() = (type_identifier?) {fieldListGrammar} ) - (type_identifier) + (type_identifier!) + (pointer_declarator + (type_identifier) + ) ) """, proc (ast: ref Ast, node: TSNode) = @@ -424,6 +427,8 @@ proc initGrammar() = if gStateRT.data[i].name == "pointer_declarator": fptr = "ptr " i += 1 + else: + fptr = "" var fname = gStateRT.data[i].val diff --git a/tests/include/test.c b/tests/include/test.c index 162645c..0312b4f 100644 --- a/tests/include/test.c +++ b/tests/include/test.c @@ -58,4 +58,12 @@ float test_call_param8(int *param1) { void *test_call9() { return NULL; -}
\ No newline at end of file +} + +void multiline1(void) {} + +void *multiline2(void) { + return NULL; +} + +void multiline3(void) {} diff --git a/tests/include/test.h b/tests/include/test.h index a8a5b74..12f052c 100644 --- a/tests/include/test.h +++ b/tests/include/test.h @@ -109,6 +109,12 @@ int test_call_param7(union UNION1 param1); float test_call_param8(int *param1); void *test_call9(); +// Issue #58 +void + multiline1(void), + *multiline2(void), + multiline3(void); + #ifdef __cplusplus } #endif
\ No newline at end of file diff --git a/tests/tnimterop_c.nim b/tests/tnimterop_c.nim index 7c4481d..d3cb26e 100644 --- a/tests/tnimterop_c.nim +++ b/tests/tnimterop_c.nim @@ -110,6 +110,11 @@ check enum13 == 4 check enum14 == 9 check enum15 == 2 +# Issue #58 +multiline1() +let p = multiline2() +multiline3() + cAddStdDir() ## failing tests |
