Re:The New ‘Absent Operator’ in Ruby’s Regular Expressions
by ebiester on Thursday March 23, 2017 @03:36PM
(#13943390)
Icon (and SNOBOL before that) had an alternate syntax that was more verbose but more readable.
I should implement something like this in ruby some day... (I did it in java long ago, but this was before you just threw things up to github and I have long since lost it.)
[ Parent
| on HN ]
Re:The New ‘Absent Operator’ in Ruby’s Regular Expressions
by sublimeloge on Thursday March 23, 2017 @07:06PM
(#13945159)
For those who haven't seen the language before, I think it's also useful to know what expression evaluation in Icon works using a recursive backtracking algorithm. This means that the most natural way of writing a string scanning parser (like the one above) more or less automatically gives you a recursive backtracking parser. Like ebiester, I too have found it to be a nice way to do certain kinds of simple string parsing.
Re:The New ‘Absent Operator’ in Ruby’s Regular Expressions
by norswap on Thursday March 23, 2017 @07:28PM
(#13945302)
Nice notation. Looks like a grammar with a bit more fancyness thrown in. I have a tool that does this kind of stuff: https://github.com/norswap/whimsy/blob/master/doc/autumn/REA...
I should try to implement something like this, to see how hard it would be (I think not too much, but I might overlook something).