diff --git a/README.md b/README.md index 7b06571..fd524e6 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,10 @@ init { } ``` -**Note: Everything after this line (for now) is either experimental or in development.** +Add comments to your code with `// comment here`, or `/* comment here */` If there's any Javascript you want to run on startup, add a JS section in your init. + ``` egg notepad @@ -71,6 +72,8 @@ init { } ``` +**Note: Everything after this line (for now) is either experimental or in development.** + Variables and values/constants can be defined with `val` and `var`, just like in Kotlin. ``` @@ -89,3 +92,9 @@ init { var myVariable = "This is a variable" } ``` + +### How to use the language + +You can transpile Chookspeak to Javascript and HTML by using the program in the repository. Compile it with `gradle installDist`, then run `./build/install/chookspeak/bin/chookspeak` (add .bat if you're a crazy Windows user). You'll notice it complains about not having a file. Add the path as your argument. eg `./build/install/chookspeak/bin/chookspeak notepad.chsp`. Your program should be compiled to HTML and Javascript in valid egg format, which can be added to your Chookchat instance. + +When running the transpiler, don't be worried if debug messages come up. For now, there's no way to error it other than having your egg declaration not at the start of your code. diff --git a/examples/main.chsp b/examples/main.chsp index d12be6c..97fdfe6 100644 --- a/examples/main.chsp +++ b/examples/main.chsp @@ -1,5 +1,4 @@ // comment lmao -/* a confusing comment */ egg notepad init { sendMessage "Hello there!" @@ -7,6 +6,9 @@ init {