Closed xsawyerx closed 4 years ago
@vickenty I realized phase statements in sub definition (sub BEGIN {...}
, etc.) were broken (identified as both a PhaseStatement and a SubStatement) and had to be supported in the same crazy hack.
Please review this horrible commit: https://github.com/xsawyerx/reimagined-guacamole/pull/39/commits/65633b222e07500ff5ffa4cff01c371b16616922.
Alternatively, we can avoid identifying sub BEGIN {...}
as a PhaseStatement, but then people would get different results between BEGIN {...}
and sub BEGIN {...}
.
This supports the following:
m//
- Similar to QLike functions but with modifiers (likeqr//
)s///
- Similar tom//
but has two arguments and modifierstr///
- Similar tos///
y///
- Similar toy///
qr{}
's regex modifiers//
- Similar tom//
but without even a function name`
- Similar toqx//
but without even a function nameWe separated what has modifiers, what doesn't.
We don't allow subroutines that can be called
q
/qq
/qw
/qx
/qr
/m
/s
/tr
/y
.We also support delimiters that appear double (
s{}{}
).However, because of how I implemented this, we don't support stuff like:
If we want to support this, we'll need to do this across all QLike operators:
s///
,y///
,tr///
,m//
,qw//
, etc.I don't think we should support that, to be honest, despite the convenience of putting regexes there.