Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
najmiter authored Jan 15, 2024
1 parent 366c0f3 commit 24865d1
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const chittify = () => {
const DOM = [];
let is_comment = false;
let cmnt_char = "";
let da_big_cmnt = "";

for (const line of code) {
const tokens = razor(line);
Expand All @@ -94,24 +93,17 @@ const chittify = () => {
}

if (is_comment && token === cmnt_char) {
line_.push(
`${spaces}<span class="comment">${cmnt_char}</span>`
);
line_.push(`${spaces}<span class="comment">${token}</span>`);

is_comment = false;
da_big_cmnt = "";
cmnt_char = "";
continue;
}

if (is_comment) {
da_big_cmnt += token;
if (i === 0) {
line_.push(
`${spaces}<span class="comment">${da_big_cmnt}</span>`
);
da_big_cmnt = "";
}
line_.push(`${spaces}<span class="comment">${token}</span>`);
spaces = "";

continue;
}
if (token === ";" || nikka_token === "comment") {
Expand All @@ -124,14 +116,14 @@ const chittify = () => {
);
spaces = "";
is_comment = true;
klass = "instructions";
while (tokens[++i] === " " || tokens[i] === "\t")
spaces += tokens[i];

cmnt_char = tokens[i] ?? "";
line_.push(
`${spaces}<span class="comment">${cmnt_char}</span>`
);
already_been_added = true;
continue;
}
} else if (!isNaN(token[0]) && notation_ok(token)) {
klass = "constant";
Expand Down

0 comments on commit 24865d1

Please sign in to comment.