From 18ad9ee36997f48ca7ff0836943cda80e1f32bb2 Mon Sep 17 00:00:00 2001 From: d6 Date: Sat, 29 Jan 2022 23:49:53 -0500 Subject: [PATCH] cleaned up --- regex.tal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/regex.tal b/regex.tal index e37b145..93ade47 100644 --- a/regex.tal +++ b/regex.tal @@ -122,7 +122,10 @@ LDA2 ;push4 JSR2 ( save (s, right) in the stack for possible backtracking ) LDA2 ;loop JMP2 ( continue on left branch ) +( track the position in the input string ) @pos $2 + +( track how many levels deep we are in parenthesis ) @parens $2 ( read and increments pos ) @@ -135,13 +138,10 @@ &is-eof POP2 POP2 &return STHr ( c ) JMP2r -( ( read pos ) +( read pos ) @peek ( -> c^ ) ;pos LDA2 LDA JMP2r -@skip ( -> ) - ;pos LDA2 INC2 ;pos STA2 JMP2r ) - ( TODO: [] + ? ) ( compile an expression string into a regex graph ) @compile ( expr* -> regex* )