This commit is contained in:
2023-08-13 13:12:16 +03:00

View File

@ -1,8 +1,13 @@
import type { Editor } from './main';
import type { File } from './AppSettings';
function codeInterceptor(code: string) {
return code.replace(/->/g, "&&")
function codeInterceptor(code: string): string {
return code
.replace(/->/g, "&&")
.replace(/t\[(\d+),(\d+)\]/g, 'mod($1,$2)')
.replace(/b\[(\d+),(\d+)\]/g, '[$1,$2].includes(beat)')
.replace(/eb\[(\d+),(\d+)\]/g, '[$1,$2].includes(ebeat)')
.replace(/m\[(\d+),(\d+)\]/g, '[$1,$2].includes(bar)');
}
const delay = (ms: number) => new Promise((_, reject) => setTimeout(() => reject(new Error('Operation took too long')), ms));