🏴‍☠️
PirateLang
GitHub
  • Installation
  • README
  • Project Structure
    • Interpreter
    • Lexer
    • Parser
    • Shell
  • Standard Library
    • Standard.String
    • Standard.Terminal
  • Usage
    • Syntax
Powered by GitBook
On this page
  1. Usage

Syntax

Last updated 1 year ago

CtrlK
  • Structure
  • Variables
  • Conditions
  • Function definition
  • Collection
  • Comments
  • Control Flow Statements
  • Conditions
  • If Statements
  • For Loop
  • While Loop
  • Functions
  • Importing extern functions

Structure

Variables

String

Conditions

Operators have natural language and symbolic options.

Function definition

Collection

Not implemented yet

Comments

Comments are multiline by default. Everything between // and ; is treated as a comment.

Control Flow Statements

Conditions

Using an operator from: ==, !=, <, <=, >, >=. Double statements using and and or

If Statements

For Loop

While Loop

Functions

Importing extern functions

var name = variable;
var foo = "string"
var list = []
list[index]
// This is a comment;
variable == true
variabel == false
if condition
{
    //then body;
}
elif condition
{
    //then body;
}
else
{
    //then body;
}
for var name = int to int
{
    //then body;
}
foreach(var item in list)
{
    //then body;
}
while condition
{
    //then body;
}
extern Standard.Terminal.Print;

func main()
{
    Print("Hello World!");
}
==    !=        and     or
is    is not    and     or
func funcName(params) : returnType
{

}