Add future work note about unions in token type, and add

regexes.txt file for historical tracking.
This commit is contained in:
Gustavo Niemeyer 2013-04-29 12:22:24 -03:00
Родитель 7d17c9173a
Коммит 523c7d9470
2 изменённых файлов: 52 добавлений и 0 удалений

48
regexes.txt Normal file
Просмотреть файл

@ -0,0 +1,48 @@
/* 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)/

Просмотреть файл

@ -196,6 +196,10 @@ type yaml_token_t struct {
// The token data.
// [Go] These structs should all be flattened onto the outer
// struct, as many of them are naturally shared among the various
// token types. This will reduce the impact of the lack of a union.
// The stream start (for yaml_STREAM_START_TOKEN).
stream_start struct {
encoding yaml_encoding_t // The stream encoding.