Browse Source

misc

rlbr-dev
Larry Xue 5 years ago
parent
commit
23482358cb
  1. 5
      c2logic/compiler.py
  2. 11
      include/io.h

5
c2logic/compiler.py

@ -415,7 +415,10 @@ class Compiler(c_ast.NodeVisitor):
self.push(RelativeJump(self.loops[-1].start, JumpCondition.always))
def visit_Return(self, node):
self.visit(node.expr)
if node.expr is None:
self.push(Set("__rax","null"))
else:
self.visit(node.expr)
self.push_ret()
def visit_Label(self, node):

11
include/io.h

@ -0,0 +1,11 @@
#ifndef IO_H
#define IO_H
void println(char* s) {
print(s);
print("\n");
}
void printdln(double s) {
printd(s);
print("\n");
}
#endif
Loading…
Cancel
Save