Update stuff
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "pkgs"]
|
||||
path = pkgs
|
||||
url = https://chookspace.com/solstice/pkgs
|
||||
@@ -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 += `<span class="keyword">${word}</span>`;
|
||||
} else if (['input', 'print', 'println'].includes(word)) {
|
||||
result += `<span class="builtin">${word}</span>`;
|
||||
|
||||
@@ -111,6 +111,11 @@ while number < 10 {
|
||||
}</code></pre>
|
||||
<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>
|
||||
<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>
|
||||
<p>You now know everything you need to know about Solstice to start programming! You can continue reading for more information.</p>
|
||||
</div>
|
||||
@@ -173,23 +178,30 @@ while number < 10 {
|
||||
</div>
|
||||
<div id="builtins">
|
||||
<h2>Built In Functions</h2>
|
||||
<h3><code>io</code> library</h3>
|
||||
<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>
|
||||
<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" {
|
||||
puts "Good job!"
|
||||
}</code></pre>
|
||||
</div>
|
||||
<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>
|
||||
<pre class="code"><code>print("Hello, World!")</code></pre>
|
||||
<pre class="code"><code>use io
|
||||
|
||||
print("Hello, World!")</code></pre>
|
||||
</div>
|
||||
<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>
|
||||
<pre class="code"><code>println("Hello, World!")</code></pre>
|
||||
<pre class="code"><code>use io
|
||||
|
||||
println("Hello, World!")</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div id="nativecompiler">
|
||||
@@ -201,7 +213,7 @@ if guess == "password123" {
|
||||
<li>No functions at present</li>
|
||||
</ul>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
1
pkgs
Submodule
1
pkgs
Submodule
Submodule pkgs added at dbfcdb7c85
Reference in New Issue
Block a user