Commit Graph

27 Commits

Author SHA1 Message Date
1a1a475dd8 Added support to op-assign operators like '+='.
This feature is implemented by expansion, not by dedicated operators, e.g. a*=2+x is exapanded as a=a*(2+x)
2024-07-23 15:35:57 +02:00
7459057df9 Expr embeds Typer and ast implements it 2024-07-13 17:11:39 +02:00
76ce0945f7 context.go splitted in two files: expr-context.go and expr-function-go.
Expr interface moved from ast.go to the new file expr.go
2024-07-07 15:51:29 +02:00
f347b15146 Control vars are now stored in the globalCtx only.
However, it is still allowed to store control var in a local context in special situation
2024-06-08 05:49:28 +02:00
227944b3fb Removed eval() function from ast interface and implementation. Check on preset control variables is now done in initDefaultVars() 2024-06-07 09:41:10 +02:00
f66cd1fdb1 New test file for specific code section or data type 2024-06-01 16:31:50 +02:00
4d43ab2c2f context.go: setVar() renamed as UnsafeSetVar() 2024-05-19 01:27:44 +02:00
0a9543543d Remove the unused 'parent' param from the function newTerm(). 2024-05-11 06:41:06 +02:00
1f7b9131fc The 'last' variable now also receives the value of the final expression 2024-05-10 04:41:26 +02:00
1d8569d3a9 the function call procedure now check the number of actual parameters against the numer of formal parameters 2024-05-04 22:35:03 +02:00
75c0c0f681 Fix ast.go: the insert() didn't check the returned error 2024-04-26 04:26:20 +02:00
943ef3327e empty expressions no more return error, now they return nil 2024-04-20 06:56:26 +02:00
b9ea96f649 merge: solved a lot of conflicts caused by an incorect commit removal 2024-04-13 05:47:10 +02:00
838ab9fd7e control: exported all control variables by renaming them in upper case 2024-04-13 05:16:23 +02:00
55e136e9bc ast.go: String() function addedd to the Expr interface 2024-04-13 04:31:53 +02:00
8f396a35de ExprContext.SetVar() no longer requires the explicit specification of the type of number 2024-04-09 07:12:22 +02:00
9ac88bf446 made some interfaces exportable and fixed/enhaaced some selector operator versions 2024-04-08 23:17:56 +02:00
d3f388f7e1 Selector operator, multi-operand, added 2024-04-08 22:16:07 +02:00
7612a59757 Operator '@@' (export-all) added. Experimental include() function also added 2024-04-06 03:06:07 +02:00
d073d11ad3 Variable references belonging to the parent scope added ('@') 2024-04-04 12:54:26 +02:00
088e347c95 Changed SetValue() as SetVar() and GetValue() as GetVar() 2024-04-03 06:29:57 +02:00
f29b1f13b1 preset definitions and functions were moved to the new preset.go file 2024-04-02 05:00:48 +02:00
072dab4144 Expressions now support function definition 2024-04-02 04:36:03 +02:00
4e361f938e ast: now supports espression forest (multi expressions) 2024-03-31 05:57:02 +02:00
94ad968d5e ast.go: presetting of system variables before starting evaluation process 2024-03-31 05:06:24 +02:00
33841c5861 Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
522b880ca3 Added all source files 2024-03-26 07:00:53 +01:00