Tristan B. V. Kildaire 1 month ago committed by GitHub
commit 9714be54a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -475,6 +475,10 @@ jobs:
run: |
chmod +x extern_test.sh
./extern_test.sh
- name: Simple expressionless return
run: |
./tlang compile source/tlang/testing/simple_return_expressionless.t
./tlang.out
# Array support

@ -392,10 +392,18 @@ public final class DCodeEmitter : CodeEmitter
Context context = returnInstruction.getContext();
assert(context);
/* Get the return expression instruction */
Value returnExpressionInstr = returnInstruction.getReturnExpInstr();
emmmmit = "return "~transform(returnExpressionInstr)~";";
/* If there is an expression returned */
if(returnInstruction.hasReturnExpInstr())
{
/* Get the return expression instruction */
Value returnExpressionInstr = returnInstruction.getReturnExpInstr();
emmmmit = "return "~transform(returnExpressionInstr)~";";
}
/* Expression-less return */
else
{
emmmmit = "return;";
}
}
/**
* If statements (IfStatementInstruction)

@ -0,0 +1,6 @@
module simple_return_expressionless;
void func()
{
return;
}
Loading…
Cancel
Save