impl Vec3i {
fn reset(self) { // NOTE Each function in an implementation will be translated as name_name
self.x = 0.0f; // so we can have more than one function with the same name
self.y = 0.0f;
self.z = 0.0f;
}
fn reset_and_one(self) {
self.reset();
self.x = 1.0f;
self.y = 1.0f;
self.z = 1.0f;
}
}
let x:list [10]
match x {
}
defer x += 2;
let iarr:i32 [10] -> {1,1,1,1,1,1}; // denoted array of 10 ints // NOTE {0} by default
let farr [3] -> {1.0, 1.1, 1.2}; // inferred as floats
let carr [2] -> {"two", "strings"}; // inferred as strings
struct Vec2i { // NOTE will be a simple struct
x:i32;
y:i32;
}
fn double x = x*2
asm { // NOTE asm src block in emacs jade-mode
mov %1, %0;
add $1, %0;
=r (dst);
r (src);
}
asm ("mov %1, %0\n\t"
"add $1, %0"
: "=r" (dst)
: "r" (src));
// OLD
/* void push_defer_statement(const char *statement) { */
/* // Skip past "defer " to capture only the action part of the statement. */
/* const char *actual_statement = statement + strlen("defer "); */
/* if (deferStacks[scope_level].count < MAX_DEFERS) { */
/* strcpy(deferStacks[scope_level].statements[deferStacks[scope_level].count++], */
/* actual_statement); */
/* } */
/* } */
/* void pop_and_execute_defers(FILE *output_file, int level) { */
/* for (int i = 0; i < deferStacks[level].count; ++i) { */
/* print_indentation(output_file, level); */
/* fprintf(output_file, "%s\n", deferStacks[level].statements[i]); */
/* } */
/* deferStacks[level].count = 0; // Reset defer count after executing */
/* } */
-
Notifications
You must be signed in to change notification settings - Fork 0
laluxx/jade
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
a C abstraction
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published