Syntax and Semantics
1. Core Syntax
The syntax of our language combines elements of Ruby and Java. It's designed to be simple and easy to read, with all keywords and function names written in lowercase, separated by underscores when necessary. For example, to send a message to a player, you would write:
2. Data Types
Our language supports the following basic data types:
Numbers: Includes both integers and floating-point numbers.
Strings: Textual data, surrounded by double quotes.
Booleans: Represents true or false values.
Enums: To work with enum values, you need to prefix the enum with a
:
. For example, setting a playerβs gamemode:
3. Variables
Variables are dynamically typed and can be defined by simply assigning a value. You can access both variables and functions using the dot notation.
Defining Variables:
Accessing Variables and Functions: You can access variables and call functions using the dot notation. For example:
Embedding Variables and Function Calls in Strings: You can include both variables and function calls inside strings using {{}}
to create dynamic messages:
4. Operators
Arithmetic Operators: You can use standard operators like +
, -
, *
, /
, and %
for calculations.
Comparison Operators: These include ==
, !=
, >
, <
, >=
, and <=
for comparing values.
Logical Operators: Use &&
for AND, ||
for OR, and !
for NOT operations.
Assignment Operators: For modifying variables, you can use compound assignment operators such as +=
, -=
, *=
, and /=
.
Last updated