関数定義の構文解析を実�
This commit is contained in:
1 parent
09ff06ec56
commit
4b530f492e
5 files changed
+175
-2
No files matched your search
@@ -33,6 +33,7 @@ enum NodeType
|
||||
DefineVariable,
|
||||
DefineArray,
|
||||
ArrayAssign,
|
||||
DefineFunction,
|
||||
}
|
||||
abstract class Node
|
||||
{
|
||||
@@ -359,3 +360,23 @@ class ArrayAssign : Statement
|
||||
this.assignExpression = assign;
|
||||
}
|
||||
}
|
||||
class DefineFunction : Statement
|
||||
{
|
||||
wstring[] arguments;
|
||||
wstring[] outArguments;
|
||||
wstring name;
|
||||
Statements functionBody;
|
||||
this(wstring name)
|
||||
{
|
||||
this.type = NodeType.DefineFunction;
|
||||
this.name = name;
|
||||
}
|
||||
void addArgument(wstring name)
|
||||
{
|
||||
this.arguments ~= name;
|
||||
}
|
||||
void addOutArgument(wstring name)
|
||||
{
|
||||
this.outArguments ~= name;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user