Skip to content
/ Crayon Public

An interpreted programming language written in Go for idiots

License

Notifications You must be signed in to change notification settings

symful/Crayon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crayon

An interpreted programming language written in Go for idiots.

What the Fuck?

There are only tags, values, constant values, commands (statements), variables and scope. Well, for now.

How to Use

./cor.sh <File>

This bash script will build the engine and run it.

What the Fuck is a Tag?

It works like a function.

Kinds of Tag

1. MAIN

[MAIN]

It will execute when the engine ready.

2. FRAME

[FRAME XX]

It will execute after XX seconds.

3. LOOP

[LOOP]

It will execute every time until you exit the program.

4. Custom

[@AnyName]

Your own named tags! This type of tag can be called by your code.



ProTip: If you want to end a tag, just use ``` ~ ```

Kinds of Value

1. String

"This is a string"


2. Number (Float 64)

10.10


3. Bool

#yes
#no


4. PI

#PI


5. Object (Untested)

#{
    key1 = <Any>,
    key2 = <Any>
}


6. Array

#[<Any>, <Any>]


7. None (Untested)

#none


8. Scope (Untested)

{
    Command1
    Command2
}

Yeah scope is a value.

Commands

1. Exit the program

K THX BYE;


2. Console

write <Any> to console;


3. Define

define variable $[variable];


4. Assign

assign value <Any> to $[variable];


5. Delete

delete variable $[variable];


6. Global

make variable $[variable] global;


7. Math Operators

add <Number> by <Number>;
sub <Number> by <Number>;
divide <Number> by <Number>;
multiply <Number> by <Number>;


8. Logical Operators (All the results are <Bool>)

is <Any> equal with <Any>;
is <Any> not equal with <Any>;

not <Bool>;

is <Number> less than <Number>;
is <Number> less than or equal with <Number>;

is <Number> more than <Number>;
is <Number> more than or equal with <Number>;

<Bool> and <Bool>;
<Bool> or <Bool>;


Protip: You can use commands within commands like

command1 @(command2);


9. If Else

if <Bool> {
    this is scope
}

if <Bool> {
    this is scope
} else {
    this is scope
}


10. Get & Call Custom Tag

call tag @[CustomTagName] with args <Array>;

To get the arguments in the custom tag, the custom tag just need to get the variable $args.

11. Get Property

get property <Number> from <Array>;
get property <String> from <Object>;


12. Set Property

set <Any> as property <Number> from <Array>;
set <Any> as property <String> from <Object>;


13. Get Type Of (Untested)

get type of <Any>;

14. Run Scope (Untested)

run scope {
    Command1
    Command2
};


About

An interpreted programming language written in Go for idiots

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published