Open geert56 opened 1 year ago
And I just learned that also BLOCK_ENTRY is printed both in case of FYTT_BLOCK_ENTRY and FYTT_FLOW_ENTRY. I assume the latter must print FLOW_ENTRY?
Token scan mode is just a debugging aid. Are you trying to create a new YAML parser or something?
The interface is completely private and the documentation of the methods clearly state that this is just for YAML implementers.
I am just pointing out what I think to be minor errors in the code. They probably would not affect regular use. But I am interested to use fy-tool to generate the tokens output and in that case the indicated errors do cause the wrong output.
If you can share the input that causes this behavior we can have more concrete data to talk about.
In master libfyaml/src/tool/fy-tool.c:
case FYTT_BLOCK_ENTRY:
if (colorize)
fputs(A_BRIGHT_CYAN, stdout);
printf("BLOCK_ENTRY");
break;
case FYTT_FLOW_ENTRY:
if (colorize)
fputs(A_BRIGHT_YELLOW, stdout);
printf("BLOCK_ENTRY");
Oh, yeah, that's a bug - file a PR
As I said this is just a debugging aid, never been used for anything besides that until now.
Same file fy-tool.c:
case FYTT_KEY:
if (colorize)
fputs(A_BRIGHT_YELLOW, stdout);
printf("KEY");
break;
case FYTT_VALUE:
if (colorize)
fputs(A_BRIGHT_YELLOW, stdout);
printf("KEY");
fy-tool is a great tool for YAML analyzers and processors. Useful to use in some AI pipeline to feed a model with YAML code.
Sure, but the scan token interface is completely non-standard.
The event interface is probably what you need.
On Tue, Feb 7, 2023 at 4:50 PM Geert Janssen @.***> wrote:
fy-tool is a great tool for YAML analyzers and processors. Useful to use in some AI pipeline to feed a model with YAML code.
— Reply to this email directly, view it on GitHub https://github.com/pantoniou/libfyaml/issues/65#issuecomment-1420901125, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQGJWWBN36KVEB6KAAMKFLWWJOKVANCNFSM6AAAAAATMRS3P4 . You are receiving this because you commented.Message ID: @.***>
Am I allowed to create a pull request? I am trying to push my issue65 branch but am getting permission denied.
You need to fork and create the PR from your fork.
On Tue, Feb 7, 2023 at 6:16 PM Geert Janssen @.***> wrote:
Am I allowed to create a pull request? I am trying to push my issue65 branch but am getting permission denied.
— Reply to this email directly, view it on GitHub https://github.com/pantoniou/libfyaml/issues/65#issuecomment-1421040120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQGJWT2WTOFKCM2X4LB4YTWWJYNLANCNFSM6AAAAAATMRS3P4 . You are receiving this because you commented.Message ID: @.***>
I assume that
dump_scan_token
in fy-tool.c in case ofFYTT_VALUE
should print VALUE or something like that, but not KEY.