-
-
Notifications
You must be signed in to change notification settings - Fork 98
Add diagnostics (and some other improvements) #3223
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
Conversation
c75736d
to
1d63455
Compare
4a8df5c
to
64c0d99
Compare
0143b7c
to
6ab329e
Compare
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.
This is a fantastic piece of work. This had a three-part review that's not directly on GitHub as that became impractical due to the size of the PR.
We have a small list of follow-ups that we need to tackle. I fully trust that @jachris implements them before merging, so I can already greenlight this as-is.
We should avoid merging other PRs until this is in so we can avoid further merge conflicts.
a45976b
to
b63ee47
Compare
There's two conflicts, one in |
a0ded22
to
39bb243
Compare
94674d3
to
1420765
Compare
1420765
to
0bc352f
Compare
We already had this, but it got lost during the transition.
Note: This PR is quite big (because a lot of the changes were interdependant).
Changelog
tenzir -f <file>
to load and execute a file.struct diagnostic { ... }
andstruct location { ... }
to emit diagnostics (errors, warnings, notes) during parsing and execution (with more diagnostics to come in the future).parse_operator(...)
function to operator plugins (and similar for loaders/parsers/printers/saves), with a deprecated fallback tomake_operator(...)
.inspect(op)
instead ofto_string(op)
. This not only solves some incomplete escaping attempts, but also allows transporting metadata (such aslocation
) and eliminates the need for workarounds for serialization ofexport | where ...
and other optimizations.inspect
implementation, but not all plugins define operators (some resolve to already existing operator implementations). Inheriting fromoperator_plugin
implicitly adds both.stdin/stdout
for all formats (e.g. to unifywrite json
andwrite csv
).Future work
parse_operator(...)
can currently throw adiagnostic
. I don't really like this. Furthermore, as it is right now, plugin parsers cannot emit warnings. At least this should be changed.expression
. They are more or less dead code and are to be upgraded as part of the expression revamp, or eventually deleted if they stay unused.operator_base::to_string()
that usescaf::detail::stringification_inspector
. This output is not too readable, and in particular unsuitable for user-facing messages. We should consider ajson_writer
that usesto_string(...)
for some types, such as expressions.plugin::name()
overrides in connection with defining both loader and saver (or parser and printer).