-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(to_c_compiler): string literal should compile to a valid c string…
… literal
- Loading branch information
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import libs.c | ||
|
||
def myfunc(d: c.CStr) -> None: | ||
pass | ||
|
||
def main() -> int: | ||
myfunc(cast("c.CStr", "hello\nworld\n")) | ||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// YK | ||
#include "yk__lib.h" | ||
// --forward declarations-- | ||
#define yy__c_CStr char* | ||
void yy__myfunc(yy__c_CStr); | ||
int32_t yy__main(); | ||
// --structs-- | ||
// --functions-- | ||
void yy__myfunc(yy__c_CStr yy__d) | ||
{ | ||
// pass; | ||
return; | ||
} | ||
int32_t yy__main() | ||
{ | ||
yy__myfunc(((yy__c_CStr)"hello\nworld\n")); | ||
return INT32_C(0); | ||
} | ||
#if defined(YK__MINIMAL_MAIN) | ||
int main(void) { return yy__main(); } | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters