関数定義の構文解析を実�
This commit is contained in:
@@ -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