Added earlier examples, for history!
This commit is contained in:
parent
eafcef584d
commit
2693fcb795
1 changed files with 16 additions and 0 deletions
16
examples/earlier-syntax.c
Normal file
16
examples/earlier-syntax.c
Normal 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
|
||||
"}";
|
||||
|
||||
|
||||
Loading…
Reference in a new issue