A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
|
|
@ -0,0 +1,24 @@
|
|||
Section Header
|
||||
|
||||
+ name := TEST_C_INTERFACE;
|
||||
|
||||
// this will be inserted in front of the program
|
||||
- external := `#include <string.h>`;
|
||||
|
||||
Section Public
|
||||
|
||||
- main <- (
|
||||
+ s : STRING_CONSTANT;
|
||||
+ p : NATIVE_ARRAY[CHARACTER];
|
||||
|
||||
s := "Hello World!";
|
||||
p := s.to_external;
|
||||
// this will be inserted in-place
|
||||
// use `expr`:type to tell Lisaac what's the type of the external expression
|
||||
p := `strdup(@p)` : NATIVE_ARRAY[CHARACTER];
|
||||
s.print;
|
||||
'='.print;
|
||||
p.println;
|
||||
// this will also be inserted in-place, expression type disregarded
|
||||
`free(@p)`;
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue