This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
Syntax Manual v2.0.1 #70
iwl-lyam
announced in
Syntax Guide
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Welcome to the v2.0.1 Syntax Manual! I will run through all valid instructions/syntax in Evaluate.
Functions
Like most programming languages, functions can be called using the format:
functionname(parameters)
.You create functions using the
function
block modifier. In an upcoming update there custom parameters and scope will be added. For now, any variables declared inside function blocks they will be global.Standard Library
As with other libraries, Standard must be imported:
import standard
printf
As with some other programming languages, printf takes a formatted string and prints it out. It can be formatted using:
Memory
Strings can be defined using quotes
" "
. Single quotes' '
won't work.Variables
Evaluate is aiming to enforce static typing in the future. To start, it requires type annotations upon declaration. The valid types are:
Int_8
Int_16
Int_32
Int_64
Char
String
Bool
The standard format for declaring variables is
<type> <name> = <value>
.Blocks
Blocks are snippets of code that can have modifiers applied to them, such as
loop
.Block modifiers change how the code in the blocks is compiled. The valid modifiers are:
loop <amount>
function <name>
The standard format for using blocks is
{ <block code> } [modifier]
Block Manipulation
In Evaluate, you can manipulate blocks - specifically blocks using
loop
- with control statements. The valid control statements are:break
(exits loop)be <op1> <op2>
(exits loop if equal)bne <op1> <op2>
(exits loop if not equal)bz <op1>
(exits loop if zero)bnz <op1>
(exits loop if not zero)Using these, you can create programs like for loops and while loops.
Imports
Evaluate provides some libraries for extra use.
standard
ascii
These are imported with the
import
keyword:import <library>
.Beta Was this translation helpful? Give feedback.
All reactions