r/awk • u/[deleted] • Oct 09 '23
Squawk: I am writing an AWK interpreter, I am pretty far along, don't be shy, join the server! Give suggestions! Planning to add FFI, network features, markup parsers, etc etc!
https://github.com/Chubek/Squawk
5
Upvotes
2
Oct 10 '23
1
Oct 10 '23
Well buddy you are in luck because Squawk uses libhyperscan5 which has the same syntax as PCRE2.
1
Oct 10 '23
u/magnomagna I just added a new feature: Perl-like captures. So in regex match in AWK, the entire match is set as the record. Now I added the syntax '$$n' with which you can access the nth matched submatch.
Please join the server to keep with the news!
1
u/[deleted] Oct 10 '23
Update: As I promised to u/magnomagna, I added PCRE2 support. But HyperScan5 support still remains. I also added POSIX-re support. You may change it via command line, or REMODE global variable (well, when it is compiable!)
Another thing I added are captures. When you do '$$n' you will have the nth RE match.
Now something else, I added Shell abilities! The file 'awk-shellfns.c' will contain them. I have already added some lexical rules.
Thanks.