-
Notifications
You must be signed in to change notification settings - Fork 299
Is it possible to do partial parsing, fallback and wildcard ? #156
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
Comments
I don't think these things are currently possible. I'm also not sure if they are desirable? |
@ahmedcharles Why would they not be desirable? There are two, quite clear, requests for it above. |
I simply take the general position that the answer to most feature requests should be 'no, with a hint of maybe' rather than 'sure, why not'. There's a very insightful video here: https://www.youtube.com/watch?v=gXdS3IftP0Y I'll paraphrase the core observation: If you are considering adding a feature and you make a choice that you later realize was wrong, one situation is significantly easier to fix than the other. |
Maintenance burden is unrelated to whether or not this feature is desirable. |
It depends. Is it desirable to implement or desirable to an arbitrary user? Communication is hard. |
For fallback, there is #195. |
That is only true if you ended up keeping the user for whom the question is relevant. It is nearly impossible to fix the problem caused by losing a user to a competing solution, so we ought not be this glib about rejected reasoned and use-case-derived feature requests. At minimum, if you want to make the claim that a feature is undesirable, you ought to say why that is, and "saying no is better than saying yes" ought not be a sufficient justification. |
This often happens in open source where someone needs some feature because he needs it for what he is using the crate for. But the feature doesn't align with the crate goals. I'm not saying this is the case here - but if often happens. The thing is - we haven't had much progress over the last few months and it is difficult given each of our timeframes. It might be difficult to review an entire new feature or work on it from the perspective of a co-maintainer. That said if @wycats or @gwenn or anyone else wants to give this a try and work out a PR it will be nice, though there are chances that it might be closed if it doesn't seem desirable. I will discuss this issue the next time i have a conversation with the other co-maintainers. |
Of course, and in such a case it's quite reasonable to say no. It is also quite reasonable to say "I have no time to look into this yet". I find it unreasonable to say "I'm just going to assume this feature might be undesirable unless you work very hard to prove otherwise". |
Hello,
I am trying to parse the SQLite3 grammar with LALRPOP here.
And some Lemon features do not seem to be avaible with LALRPOP.
Maybe I missed them while reading the documentation.
If they are not supported, it is not really important.
Many thanks for this great parser.
Partial parsing
SQLite parses one command at a time.
The user can choose to ignore the unparsed chunk (
pzTail
).Or choose to parse the next command.
Lemon grammar
For example, if the input is
CREATE TABLE test (data); INSERT INTO test VALUES ('');
.SQLite parses the first statement
CREATE TABLE test (data);
and returns the unparsed chunkINSERT INTO test VALUES ('');
.Fallback
SQLite makes possible to use some keywords without double-quoting them where an identifier is expected.
For example,
CREATE TABLE test (view TEXT);
is a valid statement.The
view
keyword becomes a simple identifer.Lemon grammar
Wildcard
Lemon grammar
https://www.sqlite.org/src/doc/trunk/doc/lemon.html
The text was updated successfully, but these errors were encountered: