Skip to content

Commit 1386fe6

Browse files
authored
Add missing C output for inline decorator example (pyccel#1936)
This PR adds the missing C output for the example demonstrating the inline decorator with optional variables in the decorators Markdown file. This update ensures that the documentation is complete and provides a clear understanding of the expected C output for this feature.
1 parent f79d2eb commit 1386fe6

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
2626
- #1895 : Add Python support for dict initialisation with `{}`.
2727
- #1895 : Add Python support for dict initialisation with `dict()`.
2828
- #1886 : Add Python support for dict method `pop()`.
29+
- #1936 : Add missing C output for inline decorator example in documentation
2930
- \[INTERNALS\] Added `container_rank` property to `ast.datatypes.PyccelType` objects.
3031
- \[DEVELOPER\] Added an improved traceback to the developer-mode errors for errors in function calls.
3132

docs/decorators.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,36 @@ end module boo
597597

598598
The generated C code:
599599
```c
600+
#include "boo.h"
601+
602+
603+
/*........................................*/
604+
int64_t f(int64_t* a, int64_t* b, int64_t* c, int64_t* d)
605+
{
606+
int64_t Dummy_0000;
607+
int64_t Dummy_0001;
608+
int64_t Dummy_0002;
609+
int64_t Dummy_0003;
610+
int64_t Dummy_0004;
611+
int64_t Dummy_0005;
612+
int64_t Dummy_0006;
613+
int64_t Dummy_0007;
614+
Dummy_0000 = INT64_C(2);
615+
Dummy_0001 = INT64_C(4);
616+
(*a) = Dummy_0000 + Dummy_0001;
617+
Dummy_0002 = INT64_C(3);
618+
Dummy_0003 = INT64_C(5);
619+
(*b) = Dummy_0002 + Dummy_0003;
620+
Dummy_0004 = INT64_C(6);
621+
Dummy_0005 = INT64_C(5);
622+
(*c) = Dummy_0004 + Dummy_0005;
623+
Dummy_0006 = INT64_C(3);
624+
Dummy_0007 = INT64_C(4);
625+
(*d) = Dummy_0006 + Dummy_0007;
626+
return 0;
627+
}
628+
/*........................................*/
629+
600630
```
601631
602632
### Import Error when imported from the shared library

0 commit comments

Comments
 (0)