Comparing to pico-8 builtins

This commit is contained in:
dylan
2023-05-09 23:06:09 -07:00
parent 26c0ff590c
commit d68a207df6
3 changed files with 173 additions and 6 deletions

View File

@@ -64,6 +64,8 @@ const values = [
"null",
"true",
"undefined",
"NaN",
"Infinity",
];
const operator = [
"&&",
@@ -659,6 +661,9 @@ const draw = () => {
const lines = token.value.split("\n");
lines.forEach((line, i) => {
let color = tokenColors[token.type];
if (builtins.includes(token.value)) {
color = builtinColor;
}
if (keywords.includes(token.value)) {
color = keywordColor;
}
@@ -671,9 +676,6 @@ const draw = () => {
if (punctuation.includes(token.value)) {
color = punctuationColor;
}
if (builtins.includes(token.value)) {
color = builtinColor;
}
drawText(1+x+cx-scrollX, 1+y+cy-scrollY, line, color);
if (i === lines.length-1) {
cx += measureText(line)+1;