This P++ Interpreter is a fully-fledged interpreter that supports: - recursive call stack - working with variables, lists, and memory - loops: forever/for/while - working with user-defined functions: define - passing calculations from a function inside a function: func1(?func2()); - executing scripts without refreshing the screen: refreshscreen(false); - Support for full conditions: if() { ... } elif() {} else {} - Support for full while/for/continue/break functions - Supports variable scopes, separating local and global variables - Supports code comments via: /*...*/ - Supports importing code files (READ-ONLY-MEMORY list) and returning all imported files The P++ code editor offers: - Mobile keyboard - Interface scaling to fit all screens - Code saving/loading - Automatic code completion in case of interpreter overload - Color highlighting of passed variables, functions, and strings - Smart code completion that recognizes not only system functions but also user-created ones - Full integration with desktop and mobile devices - Offers four starter codes for learning the language - Sidebar for interacting with different project files - Ability to create a new file, edit the name, and delete a file - Smart contextual hints that suggest built-in functions, user-defined functions, and variables - Hint dependency Variables based on their scope! - Color and letter coding next to the tooltip! - Automatic indentation when you press Enter! - Highlighting of unclosed parentheses! ###Updates: ---{12.03.2026}--- - Added space(args) { ... } and instantly() { ... } constructs to the P++ interpreter - Added comment support in the IDE and the P++ interpreter - Added hints that appear in a window near the cursor while typing code - Added code completion, which suggests not only system functions but also functions created in the code. - Added automatic scrolling to the last value output to the console when outputting a value - Added automatic closing of ```"```. ---{15.03.2026}-- - Added file support in the IDE - Added contextual tooltips in the IDE - Added tooltips for created variables, which are shown only in the variable's scope. - Added a sidebar for interacting with multiple files - Added the ability to create, edit, and delete files, as well as change the file name - Added color coding to tooltips, dividing them into categories: {s - user-defined function template, f - function, v - variable, c - construct} ---{02.05.2026}--- - Fixed a scope issue when using else at the interpreter level. - Added else and elif to tooltips. - Added support for function and variable hints from other imported files. - Added elif support to the interpreter. - Fixed issues with conditions using continue/break/return. - Improved condition performance.
###Documentation: 1. Each function must end with ";" 2. To retrieve the value of a variable, precede its name with ```!```: var1 = "hello, world!"; print(!var1); 3. To pass the function result as an argument, first include "?": define:get_name() { return("user"); } print("user name: ", ?get_name()); 4. To create a custom function, precede its name with ```define:``` and specify the name, specify the arguments it receives in ```()```, and specify the function scope with ```{}```: define:sum(a, b, c) { return(!a + !b + !c); } print("sum: ", ?sum(2,2,2)); 4.1. To return a value for a function, return it using ```return(value);``` 5. To create a list, specify the list name and its value: var1 = [1,2,3]; 5.1. To interact with a list, use: ```var1.function(args)``` or ```function(var1, args)```; these options are equivalent. 5.2. List functions: name.length() - returns the length var.get(index) - returns the value of an element var.set(value, index) - stores a new value at a given index in the list var.delete(index) - removes an element from the list var.insert(value, index) - inserts a value var.append(value) - appends a value to the end var.replace(value, index) - replaces a list element with a new one var.contains(value) - whether the list contains a value var.index(value) - returns the index of the element in the list 6. Working with Strings: var = "hello, world"; 6.1. Functions for working with strings: var.get(index) == get(var, index) - gets a specific character var.length() == length(var) - the length of the string var.contains(value) == contains(var, value) - whether the string contains a value var.substring(position, len) == substring(var, position, len) - extracts a substring from a string by its starting position and the length to extract var.join(value) == join(var, value) - concatenates the first string and the second var.split(value) == split(var, value) - splits a string by value 7. Working with Variables: 7.1. Creating a variable with a value: a = 5; b = 10; print(!a + !b);; 7.2. Creating ```null``` variables: create(a, b); 7.3. Deleting variables: clear(a, b); P.S. Accepts multiple arguments (variable names) 8. Working with Memory: calloc(value) - allocates a memory block of size value realloc(pointer, value) - resizes the pointer's memory block free(pointer) - deletes the memory block memsize(pointer) - returns the size of the memory block memget(pointer, index) - returns the value of a cell in the memory block memset(pointer, index, value) - writes the new value ```value``` to the ```index``` cell of the ```pointer``` block 8.1. Example: var = ?calloc(5); memset(!var, 0, 10); print(?memget(!var, 0)); realloc(!var, 10); free(!var); 9.Loops: 9.1. forever(value) { loop body }: forever takes only one parameter - the number of repetitions 9.2. while(bool) { loop body }: while takes a condition, while the loop runs 9.3. for(initialization, condition, step) { loop body }: for(i=0, !i<10, i+=1) { print("loop for, i = ", !i); } 9.4. continue(); - skips the loop iteration 9.5. break(); terminates the loop 10. Built-in timer: 10.1. ```timer("reset");``` - resets the timer 10.2. ```timer("get");``` - returns the timer's time 10.3. Example: timer("reset") forever(10) { print("this is a delay"); } print(?timer("get")); 11. Working without screen refresh: refreshscreen(bool); 11.1. Accepts arguments: true/false true - refresh screen false - do not refresh screen 11.2. Not recommended for use when testing code! 12. instantly is a special scoped function that disables screen refresh internally and then reverts screen refresh to its original state. It is used for heavy calculations: ```p++ instantly() { forever(100) { print("hello, world); } } ``` 13. space(args) { /*body*/ } takes variable names as arguments to create local copies for interaction: ```p++ a = 1; b = 1; c = 1; space(a, b) { a = 2; b = 2; c = 2; print("a: ", !a, ", b: ", !b, ", c: ", !c); /*all variables will be equal to 2*/ } print("a: ", !a, ", b: ", !b, ", c: ", !c); /*variables a and b will be equal to 1, and c will be equal to 2*/ ``` 14. Import code From a file and viewing imports: 14.1. Importing code: ```p++ import(files); ``` Example: ```p++ import(degree); /*file contents are imported*/ print("2^2=",?degree(2,2); ``` 14.2. Viewing all imports: registry() - returns a list of all imports ```p++ import(file1,file2); print(?registry()); /*will print a list: [file1,file2]*/ ``` 15. Conditions: if(condition) { /*code*/ } elif(condition) { /*code*/ } else { /*code*/ } Conditions fully support integration with loops and user functions!