Skip to content

Commit

Permalink
Merge e058313 into ebefcd5
Browse files Browse the repository at this point in the history
  • Loading branch information
deavmi committed May 26, 2024
2 parents ebefcd5 + e058313 commit 8d95ca9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ jobs:
run: |
./tlang compile source/tlang/testing/simple_function_recursion_factorial.t
./tlang.out
- name: Simple function (statement-level)
run: |
./tlang compile source/tlang/testing/simple_func_statement.t
./tlang.out
# TODO: Re-enable when we support the `discard` keyword again
#- name: Simple variables
Expand Down
2 changes: 2 additions & 0 deletions source/tlang/compiler/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ unittest


"source/tlang/testing/simple_pointer_array_syntax.t",

"source/tlang/testing/simple_func_statement.t"
];
foreach(string testFile; testFiles)
{
Expand Down
3 changes: 3 additions & 0 deletions source/tlang/compiler/symbols/data.d
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@ public final class FunctionCall : Call, MStatementSearchable, MStatementReplacea
{
super(functionName);
this.arguments = arguments;

/* Weighted as 2 */
weight = 2;
}

public override string toString()
Expand Down
14 changes: 14 additions & 0 deletions source/tlang/testing/simple_func_statement.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module simple_func_statement;

void k(int* p)
{

}

int main()
{
int* arr;
k(arr);

return 0;
}

0 comments on commit 8d95ca9

Please sign in to comment.