Added dev target in makefile, added regexp-dispatch and example

This commit is contained in:
2026-04-15 22:25:34 +02:00
parent 1fdaee0b57
commit 5afd363aa7
5 changed files with 256 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
import { RegExp_Tokenizer, RegExp_Token_Rule } from '@efforting.tech/parsing/regexp-dispatch';
const rt = new RegExp_Tokenizer();
rt.add_rules(new RegExp_Token_Rule(/\w+/, 'word'));
rt.set_default_identifier('random stuff');
//console.log(rt.rules);
//console.log(rt.closest_scanning_match('#Hello World!'));
for (const m of rt.iter_matches('#Hello World!')) {
console.log({class: m.constructor.name, identifier: m.identifier, value: m.value, captured: m.captured });
};