Add the ability to define local functions inside nodes.
This will result in a number of changes
1) In start node, make two sections, Test Model and Parameters, both collapsible, text left-aligned, with an arrow on the right
2) In normal node, make two sections, Local Funcs and Main Code, both collapsible, text left-aligned, with an arrow on the right
For the left menu
3) Rename Functions to Main Funcs
4) Rename Inline to Inline Funcs
5) Move User to its own section, below Inline Funcs, and call it User Funcs
6) Inside User Funcs make three sections:
Create Local
Local
Global
7) In Create Local, add the following
Def Func0 - create a func with 0 args
Def Func1 - create a func with 1 args
Def Func2 - create a func with 2 args
Def Func3 - create a func with 3 args
Return - inserts a return statement into a function
8) If the section Local Funcs is collapsed, then Create Local should be disabled.
9) When you click a Def Func ..., it inserts the function into the Local Funcs section. If one of the lines if selected, then it inserts under that line. If not, it inserts at the bottom of that section.
10) When inserted, the Def Func should look like this
Def [funcname] Func [arg0] [arg1]# code# code
11) Once a function has been inserted into the Local Funcs section, its name will appear in User Funcs > Local. The order of the names should match the order of the Local Funcs.
12) When you click one of the names in User Funcs > Local, it will insert the function into the code.
13) If the function contains a Return, then it will add:
[var] = userlocal.name [arg0] [arg1] [arg2]
14) If the function contains no Return, then it will add:
userlocal.name [arg0] [arg1] [arg2]
15) The parser should check the function body and should check if the functions that are called actually exist
15) Global functions work as before but should now look like this
[var] = userglobal.name [arg0] [arg1] [arg2]userglobal.name [arg0] [arg1] [arg2]
Add the ability to define local functions inside nodes.
This will result in a number of changes
1) In start node, make two sections,
Test Model
andParameters
, both collapsible, text left-aligned, with an arrow on the right2) In normal node, make two sections,
Local Funcs
andMain Code
, both collapsible, text left-aligned, with an arrow on the rightFor the left menu
3) Rename
Functions
toMain Funcs
4) Rename
Inline
toInline Funcs
5) Move
User
to its own section, belowInline Funcs
, and call itUser Funcs
6) Inside
User Funcs
make three sections:Create Local
Local
Global
7) In
Create Local
, add the followingDef Func0
- create a func with 0 argsDef Func1
- create a func with 1 argsDef Func2
- create a func with 2 argsDef Func3
- create a func with 3 argsReturn
- inserts a return statement into a function8) If the section
Local Funcs
is collapsed, thenCreate Local
should be disabled.9) When you click a
Def Func ...
, it inserts the function into theLocal Funcs
section. If one of the lines if selected, then it inserts under that line. If not, it inserts at the bottom of that section.10) When inserted, the Def Func should look like this
Def [funcname] Func [arg0] [arg1]
# code
# code
11) Once a function has been inserted into the
Local Funcs
section, its name will appear inUser Funcs > Local
. The order of the names should match the order of theLocal Funcs
.12) When you click one of the names in
User Funcs > Local
, it will insert the function into the code.13) If the function contains a
Return
, then it will add:[var] = userlocal.name [arg0] [arg1] [arg2]
14) If the function contains no
Return
, then it will add:userlocal.name [arg0] [arg1] [arg2]
15) The parser should check the function body and should check if the functions that are called actually exist
15) Global functions work as before but should now look like this
[var] = userglobal.name [arg0] [arg1] [arg2]
userglobal.name [arg0] [arg1] [arg2]