Update docs for structs and objects

This commit is contained in:
2026-01-27 14:27:09 +11:00
parent f2a1b5a3ac
commit 9648744e17
2 changed files with 25 additions and 2 deletions

View File

@@ -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'].includes(word)) {
if (['def', 'if', 'while', 'return', 'ground', 'puts', 'def', 'struct', 'new'].includes(word)) {
result += `<span class="keyword">${word}</span>`;
} else if (['input', 'print', 'println'].includes(word)) {
result += `<span class="builtin">${word}</span>`;
@@ -87,7 +87,7 @@ function highlightSolstice(code) {
}
// Check for operators
else if ('+-*/=!<>'.includes(code[i])) {
else if ('+-*/=!<>:'.includes(code[i])) {
let op = code[i];
if (i + 1 < code.length && '='.includes(code[i + 1])) {
op += code[i + 1];