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
filterx: add parse_xml()
#4863
Closed
Closed
filterx: add parse_xml()
#4863
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Build FAILURE |
alltilla
force-pushed
the
filterx-xml-parser
branch
from
March 19, 2024 15:36
78591da
to
d683362
Compare
Build FAILURE |
alltilla
force-pushed
the
filterx-xml-parser
branch
5 times, most recently
from
March 21, 2024 10:11
05e8b46
to
66a61b3
Compare
alltilla
force-pushed
the
filterx-xml-parser
branch
3 times, most recently
from
March 25, 2024 08:40
58674bd
to
7270683
Compare
alltilla
changed the title
[5/5] filterx: add
[5/6] filterx: add Mar 25, 2024
parse_xml()
parse_xml()
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
They will be useful later for the generator logic. Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
We don't have generic dicts or lists in filterx. We have dict and a list interface, which can be implemented by anyone. Literal dicts and lists do not make sense in this case, however with a bit of trickery we can make them "generator"s, which use the dict and list interfaces and operate on an actual implementation. For this we introduce the merge "<<" operator, which on the left hand side expects an object that is a dict or list implementation, and a "generator" on the right hand side (in the form of literal dict and list for now, but functions will be added soon). The merge operator passes the "fillable" to the generator, which then fills it appropriatery. Please note that this is a shallow merge: * lists are always appended * dict merging works like python's dict update() function Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
We should be able to create a json_array like these: $arr = $json_array(); $arr = $json_array("[\"foo\", \"bar\"]"); $arr = $json("[\"foo\", \"bar\"]"); Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
E.g.: $js = json_array(); $js << [1, 2, 3]; $otel_arr = otel_array(); $otel_arr << [4, 5, 6]; $js << $otel_arr; $js_obj = json(); $js_obj << {"foo": 1}; $otel_kvl = otel_kvlist(); $otel_kvl << {"bar": 2}; $js_obj << $otel_kvl; Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
In continuation of the previous commit, with this we can implement generator functions, that only use the dict and list interfaces and fill the left hand side with data. Useful for parsers that return a dict or a list. Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
alltilla
force-pushed
the
filterx-xml-parser
branch
from
March 26, 2024 08:03
7270683
to
40e204c
Compare
Closing as it is really far behind the current framework. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depends on #4860, #4861, #4862 and #4866
TODO: unit tests