sarbian / ModuleManager

176 stars 96 forks source link

Feature request: Advanced constructs #157

Open Monniasza opened 4 years ago

Monniasza commented 4 years ago

This suggestion presents a new programming language for use in KSP.

Monniasza commented 4 years ago

Strings must be now explicitly stated either by single or double quotation marks, otherwise, they will be treated as variables, which might cause errors.

To create a new key, you must place '+' or '$' before the setter

All other existing syntax will be preserved

Functions

Basic data types

String, node, key, number, boolean, list, anonymous function

Advanced data types

Achieved through specialized functions.

Operators

Grouping

Why double brackets?

Double symbols are much rarer in the text - to say text explicitly, use quotation marks.

Where?

It will need a new file format - which distinguishes it from simpler patches. Suggestions for file extension:

Why?

How?

Existing patches should not be called 'scripts' - they will be more advanced form of data.

Constructs

'-' with text

"qwertyuiop" - 3 = "qwertyu" 3 - "qwertyuiop" = "rtyuiop" 3 - "qwertyuiop" - 3 = "rtyu"

Remove the last instance: "anobnoa" -< "no" = "anoba" Remove last instance "anobnoa" >- "no" = "abnoa" Remove first instance "anobnoa" - "no" = "aba" Remove all instances