Skip to content

Commit c54e554

Browse files
authored
added dog expression ("@")
1 parent a9bff6b commit c54e554

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

SourceCode/ast/DogExpression.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace OwnLang.ast.lib
8+
{
9+
public class DogExpression : Expression
10+
{
11+
private LdefExpression ldef;
12+
public DogExpression(LdefExpression ldef)
13+
{
14+
this.ldef = ldef;
15+
}
16+
17+
public Value eval()
18+
{
19+
Value[] zero_args = new Value[0];
20+
return ((Ldef)((ObjectValue)ldef.eval()).asObject()).execute(zero_args);
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)