Update stuff

This commit is contained in:
2026-01-28 18:31:10 +11:00
parent 45489caa1d
commit 7710b8923a
4 changed files with 24 additions and 8 deletions

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "pkgs"]
path = pkgs
url = https://chookspace.com/solstice/pkgs

View File

@@ -64,7 +64,7 @@ function highlightSolstice(code) {
const word = code.substring(i, end); const word = code.substring(i, end);
// Check what type of word it is // 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 += `<span class="keyword">${word}</span>`; result += `<span class="keyword">${word}</span>`;
} else if (['input', 'print', 'println'].includes(word)) { } else if (['input', 'print', 'println'].includes(word)) {
result += `<span class="builtin">${word}</span>`; result += `<span class="builtin">${word}</span>`;

View File

@@ -111,6 +111,11 @@ while number &lt; 10 {
}</code></pre> }</code></pre>
<h3>Calling Functions</h3> <h3>Calling Functions</h3>
<p>Function calling is done like in most other programming languages, with the syntax <code>function(arg1, arg2, arg3)</code>.</p> <p>Function calling is done like in most other programming languages, with the syntax <code>function(arg1, arg2, arg3)</code>.</p>
<h3>Importing Other Code</h3>
<p>Solstice allows you to write libraries in Solstice, or write wrappers for Ground libraries. Use the <code>use</code> keyword, followed by an identifier to import the library.</p>
<pre class="code"><code>use io
println("Hello!")</code></pre>
<h3>That's it!</h3> <h3>That's it!</h3>
<p>You now know everything you need to know about Solstice to start programming! You can continue reading for more information.</p> <p>You now know everything you need to know about Solstice to start programming! You can continue reading for more information.</p>
</div> </div>
@@ -173,23 +178,30 @@ while number &lt; 10 {
</div> </div>
<div id="builtins"> <div id="builtins">
<h2>Built In Functions</h2> <h2>Built In Functions</h2>
<h3><code>io</code> library</h3>
<div id="input_string_msg__string"> <div id="input_string_msg__string">
<h3>input(string msg) string</h3> <h4>input(string msg) string</h4>
<p>Gets 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.</p> <p>Gets 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.</p>
<pre class="code"><code>guess = input("What is the password? ") <pre class="code"><code>use io
guess = input("What is the password? ")
if guess == "password123" { if guess == "password123" {
puts "Good job!" puts "Good job!"
}</code></pre> }</code></pre>
</div> </div>
<div id="print_string_msg__string"> <div id="print_string_msg__string">
<h3>print(string msg) string</h3> <h4>print(string msg) string</h4>
<p>Prints a string to the console.</p> <p>Prints a string to the console.</p>
<pre class="code"><code>print("Hello, World!")</code></pre> <pre class="code"><code>use io
print("Hello, World!")</code></pre>
</div> </div>
<div id="println_string_msg__string"> <div id="println_string_msg__string">
<h3>println(string msg) string</h3> <h4>println(string msg) string</h4>
<p>Prints a string to the console. Appends a new line afterwards.</p> <p>Prints a string to the console. Appends a new line afterwards.</p>
<pre class="code"><code>println("Hello, World!")</code></pre> <pre class="code"><code>use io
println("Hello, World!")</code></pre>
</div> </div>
</div> </div>
<div id="nativecompiler"> <div id="nativecompiler">
@@ -201,7 +213,7 @@ if guess == "password123" {
<li>No functions at present</li> <li>No functions at present</li>
</ul> </ul>
<p>To try the native compiler, use this command:</p> <p>To try the native compiler, use this command:</p>
<pre class="code"><code>solstice program.sols --output program --type native --nostdlib</code></pre> <pre class="code"><code>solstice program.sols --output program --type native</code></pre>
<h3>Debugging</h3> <h3>Debugging</h3>
<p>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.</p> <p>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.</p>
</div> </div>

1
pkgs Submodule

Submodule pkgs added at dbfcdb7c85