-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: update generator for Tarantool v3
#4
api: update generator for Tarantool v3
#4
Conversation
As result, do we have incompatible changes? |
It is expected: |
573120b
to
407e2bb
Compare
Yes. For example, current |
317afae
to
c2bb250
Compare
We are only interested in the names of the constants and their values in the Go code. Were there any incompatible changes? I noticed only that |
bc2f584
to
b1974a0
Compare
Oh, ok. There are no other incompatible changes, other than that. Changelog updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch! I would like to clarify the changelog a little more.
756308c
to
e8398c7
Compare
It sounds like good news, we don’t need to bump the major version, it will be enough to release 0.2.0. And we could release 1.0.0 after Tarantool 3.0. |
grep -oP "[\t ]+[A-Z0-9_]+[\t ]+=[\t ]+[\-0-9xa-f <]+" | \ | ||
awk '{val=$1;$1=$2="";printf("\t\t{iproto.%s, \"%s\",%s},\n", val, val, $0)}' | ||
grep -oP "[\t ]*[A-Z0-9_]+[\t ]+=[\t ]+[A-Z_]*[\-0-9xa-f <\+]+" | \ | ||
awk '{val=$1;$1=$2="";gsub(/[A-Z][A-Z0-9_]+/,"int(iproto.&)",$0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why not using only awk match? e.g.:
awk '/match/ {code}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it can be done only by using awk. We need to leave only matched string (but not the whole line it is in). In the current code grep -o
is doing that, and its output we pass to the awk.
For example (https://github.com/tarantool/tarantool/blob/ddaa5a320ee8d8d1009e07bbf6b8fe5cb4acbb45/src/box/iterator_type.h#L64C2-L64C71): from the string
ITER_EQ = 0, /* key == x ASC order */
we need to get ITER_EQ = 0
and refactor it to the {iproto.ITER_EQ, "ITER_EQ", 0},
.
# arg1 - name of the define, containing the prefix. | ||
# arg2 - path to a C code. | ||
function read_prefix { | ||
read_define $1 $2 | grep -oP "\) .+?#" | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: all this can be done with one call to awk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated (last sed from this function now merged with awk, but I left the grep to use only the matched strings, not the whole lines).
Updated generation of constants (and tests) for Tarantool `v3`. Unfortunately, new generator does not support Tarantool version < `v3`, due to some naming differences for enums. Part of tarantool/go-tarantool#337
e8398c7
to
d13758c
Compare
Updated generation of constants (and tests) for Tarantool
v3
. Unfortunately, new generator does not support Tarantool version <v3
, due to some naming differences for enums.Part of tarantool/go-tarantool#337