experiment

This commit is contained in:
Felix Roos
2025-09-19 22:00:20 +02:00
parent 3fff4609a0
commit c6e5ca2710
+5
View File
@@ -45,6 +45,11 @@ export class MondoParser {
}
// takes code string, returns list of matched tokens (if valid)
tokenize(code, offset = 0) {
code = code.trim();
// multilinebreak -> stack
code = code.replaceAll(/(\r?\n){2,}/g, ',');
// single line break -> pipe
code = code.replaceAll('\n', ' # ');
let tokens = [];
let locEnabled = offset !== -1;
let trim = () => {