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* )