onetrueawk / awk

One true awk
Other
1.98k stars 159 forks source link

Harden regex bracket expression lexing #138

Closed silverneko closed 2 years ago

silverneko commented 2 years ago

Parse character class [::], collating symbol [..] and equivalence class [==] within a bracket expresion, so that we can determine the start and end of a bracket expression more accurately, thus determine the start and end of a regular expression more accurately in the lexer.

Change the brackets variable from a counter to a tristate variable,

This approach addresses the failing cases described in https://github.com/onetrueawk/awk/issues/135#issuecomment-979081899

plan9 commented 2 years ago

I appreciate the effort to repair this issue, but I don't like amount of code it adds for literally the pleasure of avoiding an escape. I will not continue with this, arnold's change has been reverted.

silverneko commented 2 years ago

I see