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
Experimental REPL PoC #136
Conversation
Codecov Report
@@ Coverage Diff @@
## main #136 +/- ##
==========================================
- Coverage 87.85% 87.73% -0.13%
==========================================
Files 20 20
Lines 2257 2258 +1
==========================================
- Hits 1983 1981 -2
- Misses 274 277 +3
Continue to review full report at Codecov.
|
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.
Left some comments, would also be great to add more documentation to partiql-cli.rs
.
.iter() | ||
.any(|err| matches!(err, ParseError::UnexpectedEndOfInput)) | ||
{ | ||
Ok(ValidationResult::Incomplete) |
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.
From couple errors I've seen, this can be as a result of incomplete Grammar, do we want to provide some hints or perhaps link for cutting an issue if the input appears to be correct. For example before this PR we were getting UnexpectedEndOfInput
for SELECT * FROM a AS a CROSS JOIN c AS c AT q
.
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'm sure to bring this out of PoC we will need something more robust here. For now, this is what allows you to do things like hit <ENTER>
and continue writing the query on the next line in the middle of a query.
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.
That's fair, maybe as a follow-on we can add a README
to emphasize on the PoC.
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.
+1 a short README
would be helpful.
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.
added minimal README
ed0726d
to
ce91826
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.
Very cool! I especially like the syntax highlighting along with the syntax error underlining, which makes it easier to see where exactly an error occurred.
Left a non-blocking comment related to the long-term location for the sublime syntax files.
@@ -0,0 +1,131 @@ | |||
%YAML 1.2 |
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'm curious if there a better place to store these syntax files so they could be used by other programs. Is there a way to publish the sublime syntaxes (i.e. partiql.sublime-syntax and ion.sublime-syntax) somewhere similar to what you had done for the ACE editor (ajaxorg/ace#4630)? Alternatively, we could have a separate repo for the syntax highlighting modes that could be taken as a submodule of this repo.
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.
Yes. We should likely have all the tooling somewhere else and bring it in via submodule or something else here. The official way add a sublime extension is via https://packagecontrol.io/docs/submitting_a_package
.iter() | ||
.any(|err| matches!(err, ParseError::UnexpectedEndOfInput)) | ||
{ | ||
Ok(ValidationResult::Incomplete) |
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.
+1 a short README
would be helpful.
This is a minimal PoC for the start of a REPL. It should be considered experimental, subject to change, etc.
I wrote this in order to test the parser interface & types from the perspective of an external application. As a result, some minor tweaks were made around error reporting. Potentially a refactor of the mietter::Diagnostic stuff in this PR will be included in the parser crate in the future.
It currently accepts no commands, assuming any/all input is a PartiQL query, which it will attempt to parse. Parse errors are pretty printed to the output.
This uses:
ion
andpartiql
syntax definitionsDemo:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.