diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..47988a7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pkgs"] + path = pkgs + url = https://chookspace.com/solstice/pkgs diff --git a/docs/highlight.js b/docs/highlight.js index 566fa1a..057bd8d 100644 --- a/docs/highlight.js +++ b/docs/highlight.js @@ -64,7 +64,7 @@ function highlightSolstice(code) { const word = code.substring(i, end); // Check what type of word it is - if (['def', 'if', 'while', 'return', 'ground', 'puts', 'def', 'struct', 'new'].includes(word)) { + if (['def', 'if', 'while', 'return', 'ground', 'puts', 'def', 'struct', 'new', 'use'].includes(word)) { result += `${word}`; } else if (['input', 'print', 'println'].includes(word)) { result += `${word}`; diff --git a/docs/index.html b/docs/index.html index e4d696c..2401da8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -111,6 +111,11 @@ while number < 10 { }
Function calling is done like in most other programming languages, with the syntax function(arg1, arg2, arg3).
Solstice allows you to write libraries in Solstice, or write wrappers for Ground libraries. Use the use keyword, followed by an identifier to import the library.
use io
+
+println("Hello!")
You now know everything you need to know about Solstice to start programming! You can continue reading for more information.
@@ -173,23 +178,30 @@ while number < 10 {io libraryGets user input from the console until the next line. The msg is used as a prompt for the user. Returns inputted characters from the console.
-guess = input("What is the password? ")
+ use io
+
+guess = input("What is the password? ")
if guess == "password123" {
puts "Good job!"
}
Prints a string to the console.
-print("Hello, World!")
+ use io
+
+print("Hello, World!")
Prints a string to the console. Appends a new line afterwards.
-println("Hello, World!")
+ use io
+
+println("Hello, World!")
To try the native compiler, use this command:
-solstice program.sols --output program --type native --nostdlib
+ solstice program.sols --output program --type native
Solstice will create a temporary folder in your current directory which you can remove called ".(outputname)_solsbuild". In this folder is the assembly and object file generated by the compiler. If you think that there's a bug with Ground or Solstice, you can use these to find the issue.