in reply to Comments detected in strings
To skip comment-like sequences in strings, you need to parse both strings and comments (and anything else that might contain something that looks like a string or looks like a comment). Most likely with something like:
/$comment|$string/g
I tend to end up parsing with code like:
while( ! /\G$/gc ) { if( /\G$comment/gc ) { ... } elsif( /\G$string/gc ) { ... } elsif( /\G$neither/gc ) {
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Comments detected in strings (|)
by astroboy (Chaplain) on Oct 21, 2014 at 00:41 UTC | |
by Anonymous Monk on Oct 21, 2014 at 02:36 UTC |