blob: 4b4a20859345a4c52cc93487b79d41124f5d138e [file] [log] [blame]
/* A */ => // A
%s/\/\* \(.*\) \*\//\/\/ \1/gc
A; [// B] => A [// B]
%s/;[ \t]*\( \\/ .*\)\?$/\1/gc
type [*]name => name [*]type
%s/\(\%(\%(const\|unsigned\) \)\?\%(yaml_[a-z_]*_t\|\<int\>\|\<char\>\|\<size_t\>\)\) \(\**\)\([a-z_]\+\)/\3 \2\1/gc
if (A) return B => if A { return B }
%s/if (\(.*\)) return \([^ ]\+\)$/if \1 { return \2 }/gc
if (A) { => if A {
%s/if (\(.*\)) {$/if \1 {/gc
if (A)\n{\n => if A {\n
%s/\([ \t\/]*\)\(else\|if\)\( \)(\([^{]\+\))\n[ \t\/]*{$/\1\2\3\4 {/gc
if (A)\nB => if A {\nB\n}
%s/^\([ \t]*\/\/\)\?\( *\)if (\(.*\))\n\(.*\)/\1\2if \3 {^M\4^M\1\2}/gc
if (A\nB) { => if A\nB {
%s/\(if\|for\) (\(\_[^{]\+\)) {/\1 \2 {/gc
}\nelse\n{ => } else {
%s/^\([ \t\/]*\)}\([ \t\/\n]*\)\n\1else\(\n\1\| \){/\1} else {/gc
}\nelse if => } else if
%s/^\([ \t\/]*\)}\([ \t\/\n]*\)\n\1else if/\1} else if/gc
//static int\nyaml_*)\n//{ => //func yaml_*) bool {
%s/^\/\/\(static int\|YAML_DECLARE(int)\)\n\/\/\(yaml_\([^{]\+\n\?\)\+)\)\n\/\/{/\/\/func \2 bool {/gc
IS_X_AT => is_x
%s/IS_BLANKZ_AT(parser.buffer, \([0-9]\))/is_blankz(parser.buffer, parser.buffer_pos+\1)/