mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[Quiz] Proper symbols list
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
BEGIN {
|
||||
print "void * pointers[] = {"
|
||||
}
|
||||
|
||||
#FIXME: Is there a way to capture subexpression in awk? The following gsub is
|
||||
# kind of ugly
|
||||
/TEST\(([a-z0-9_]+)\)/ { gsub(/(TEST\()|(\))/, "", $1); print "test_" $1 "," }
|
||||
/TEST\(([a-z0-9_]+)\)/ { gsub(/(TEST\()|(\))/, "", $1); tests = tests "," $1 }
|
||||
|
||||
END {
|
||||
a = tests;
|
||||
b = tests;
|
||||
gsub(/,/, "();\nvoid ", a);
|
||||
sub(/\(\);\n/, "", a);
|
||||
print a "();";
|
||||
print "";
|
||||
print "void * pointers[] = {";
|
||||
sub(/,/, "", b);
|
||||
gsub(/,/, ",\n", b);
|
||||
print b;
|
||||
print "};"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user