Added earlier examples, for history!

This commit is contained in:
Benson Chu 2024-10-04 19:15:47 -05:00
parent eafcef584d
commit 2693fcb795

16
examples/earlier-syntax.c Normal file
View file

@ -0,0 +1,16 @@
%skip: [' ', '\t', '\n'];
%find: "if" "(" "!" "(" (cond: /[!('(', ')')]/ | "(" cond ")") ")" ")" "{"
(true_case: /[!('{', '}')]/ | "{" true_case "}")
"}" "else" "{"
(false_case: /[!('{', '}')]/ | "{" false_case "}")
"}";
%replace: "if" "(" cond ")" "{"
false_case
"}" "else" "{"
true_case
"}";