|
1 | | -[](https://github.com/mendelsshop/UMPL/actions/workflows/cargo_clippy.yml) |
| 1 | + |
| 2 | +# [](https://github.com/mendelsshop/UMPL/actions/workflows/cargo_clippy.yml) |
| 3 | + |
2 | 4 | # UMPL |
| 5 | + |
3 | 6 | If you have any Ideas for the language put contribute them in [this file](https://github.com/mendelsshop/compiler/blob/main/Ideas.md) |
4 | | -<br> |
| 7 | + |
5 | 8 | along with an example or two according of how to use it in the language. |
6 | | -<br> |
| 9 | + |
7 | 10 | With UMPL we stive to break backwards compatibility, so have fun trying to write the same code for different versions of the language, if this project even last long enough. |
8 | | -<br> |
| 11 | + |
9 | 12 | To see example code for UMPL you can see [this directory](https://github.com/mendelsshop/UMPL/tree/main/umpl_examples), and to look at the formal language grammar refer to [this file](https://github.com/mendelsshop/UMPL/blob/main/grammer.md). |
10 | | -<br> |
| 13 | + |
11 | 14 | variables in UMPL must follow the kebab-case naming convention and have no uppercase letters. |
12 | | -<br> |
13 | | -Too see the understand the keywords and their meaning, refer to [this file](https://github.com/mendelsshop/UMPL/blob/main/keywords.md). |
14 | | -<br> |
| 15 | + |
15 | 16 | There is semi working vscode extension for UMPL, you can find it [here](https://github.com/mendelsshop/UMPL_VSCode_Extension) |
16 | | -<br> |
| 17 | + |
17 | 18 | At UMPL to fix the null problem, we have invented a new type called hempty, which is the same as null, but it sounds better, and it adds to the long list of null like types across all the proggraming languages. |
18 | | -<br> |
| 19 | + |
19 | 20 | All bug reports head straight to /dev/hempty |
20 | 21 |
|
21 | 22 | # language-documentation |
| 23 | + |
22 | 24 | ## Declarations |
| 25 | + |
23 | 26 | | name | description | usage | special keywords | special variables | example(s) | |
24 | 27 | |:---:|:---:|:---:|:---:|:---:|:---| |
25 | | -| create | creates a variable | create var-name with literal or expression| N/A | N/A| ```create num-var with 5``` <br> ```create str-var with ((input `>> `))>``` ```create var with str-var```| |
26 | | -| list | creates a list | list var-name with [literal or expression literal or expression]| N/A | N/A| ```list num-list with [1 3]``` <br> ```list str-list with [8, ((input `>> `))]```| |
| 28 | +| create | creates a variable | create var-name with literal or expression| N/A | N/A| ```create num-var with 5``` <br> ```create str-var with ((input `>> `))>``` <br> ```create var with str-var```| |
| 29 | +| list | creates a list | list var-name with [literal or expression literal or expression]| N/A | N/A| ```list num-list with [1 3]```<br> ```list str-list with [8, ((input `>> `))]```| |
27 | 30 | | potato | declares a function | potato emoji-name num-of-args ⧼code⧽| return literal-or-expression| for each argument you get `$argument-number` ie `$1` for the first one etc | ```potato 😀 2 ⧼return ((plus $1 $2))>⧽```| |
28 | 31 |
|
29 | 32 | ## Control Flow |
| 33 | + |
30 | 34 | |name|description|usage|special keywords| example(s) | |
31 | 35 | |:---:|:---:|:---:|:---:|:---| |
32 | 36 | | if statement| if boolean is true do if code else do else code |if {boolean literal or expression} ⧼if code⧽ else ⧼else code⧽|N/A| ```if {true} ⧼(`true`)>⧽ else ⧼(`false`)>⧽``` <br> ```if {not((true))>} ⧼(`true`)>⧽ else ⧼(`false`)>⧽``` <br> ```if {boolean-var} ⧼if {true} ⧼(`true`)>⧽ else ⧼(`false`)>⧽ ⧽ else ⧼(`false`)>⧽```| |
33 | 37 | | loop statement | loop until the code reaches break of continue |loop ⧼code⧽ |break, continue| ```loop ⧼ if {true} ⧼(`true`)> break ⧽ else ⧼(`false`)> continue ⧽⧽``` |
34 | 38 |
|
35 | 39 | ## Keywords |
36 | | -### To call a keyword you first need create an expression so ()> or ()>> or ()< and in the expression you put another pair of parentheses and the keyeword and its arguments. |
| 40 | + |
| 41 | +### To call a keyword you first need create an expression so ()> or ()>> or ()< and in the expression you put another pair of parentheses and the keyeword and its arguments |
| 42 | + |
37 | 43 | | name | description| paremeters | returns | example(s) | |
38 | 44 | | :-: | :-: | :-: | :-: | :- | |
39 | 45 | | plus | if the first argument is a number, returns the sum of all the arguments, if its a string, each argument after is conctenated to the string, anything else wont work | any*1: argument | any | |
@@ -73,8 +79,8 @@ All bug reports head straight to /dev/hempty |
73 | 79 | |new| run custom function | function: name, arguments | whatever the function returns | ```((new 😀 3 5))>``` | |
74 | 80 | |type | returns the type of the value | [any: value] | string | ```((type 1))>```| |
75 | 81 |
|
76 | | -`*`: |
| 82 | +`*`: |
77 | 83 | sometimes you can set a variable to two values for making list in lists |
78 | | -<br> |
79 | | -`*1`: |
80 | | -one or more arguments |
| 84 | + |
| 85 | +`*1`: |
| 86 | +one or more arguments |
0 commit comments