Default source file extension: .pfc
.
Default header file extension: .pfh
.
You can import header files with eat keyword.
eat "header.pfh"
In this version of proton, all variables are global. So you can access and set them in everywhere. You can set them with assign keyword.
assign a 5
proton can determine what type is this.
You can get the value of the variable just writing its name. For example:
assign a 5
write a
A classic if expression.
Examples:
if 5 < 6 write "6 is bigger than 5"
if 90 > 6 write "90 is bigger than 6"
if "hi" is "hi" write "hi is equal to hi :D"
if "yes" not "no" write "yes is not no"
In proton, there isn't a unique expression for loop (like for, while) but you can make a loop with go keyword.
Example 1 (1, 2, 3... is line numbers):
1 meminit
2 assign a 1
3 write a
4 write end
5 assign a math sum a 1
6 go line 3
In line 6, the program goes to the third line and makes a loop goes forever.
(meminit: initializing base variables line end = end line = "\r\n")
Example 2:
1 meminit
2 assign a 1
3
4 write a
5 write end
6 assign a math sum a 1
7 if a not 5 go line 3
8 write "5"
9 write end
10 write "done."
read: makes the user must enter a value to continue the program.
Example:
assign a read
write "echo: "
write a
write: writes a output to the STDOUT.
Example:
write "hello world."
A point is like a function but it's not. It isn't takes arguments. It's just a "point" to go.
(points can be in header files.)
Example:
meminit
point test
write "hi"
endpoint
go test
memdump
exit
Example 2 (with a header file):
header.pfh:
meminit
point test
write "Enter some text: "
assign input read
write "You entered: "
write input
endpoint
source.pfc:
eat "header.pfh"
go test
write end
write "done."
memdump
exit
exits the program with an exit code (if it's specified).
Example 1:
write "hi"
exit
Example 2 (with a custom exit code):
write "hi"
exit -1
Initializes the memory with the base variables. like;
end: "\r\n"
back: "\b"
Deletes all variables from memory.
Converts a variable type to another.
assign a "15"
convert int a
or
convert double a
(in proton main integer type is double)
Discord: 85530#7651
E-mail: 855309@protonmail.com