-
Notifications
You must be signed in to change notification settings - Fork 20
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
Does not handle metadata that is a tagged literal #46
Comments
I'm not quite sure how to interpret this new type of metadata since I don't work with clojure dart, but it seems like opening up the metadata grammar rules to be just any |
Thanks for your comments.
My impression is that tagged literals are often written with a space after the symbol portion, so another way to express things is:
Here there is a space after the This way of articulating things is closer to the more commonly encountered (at least for me) uuid case:
Note the space after the FWIW, the first tweak I tried with the grammar was: meta_lit: $ =>
seq(field('marker', "^"),
repeat($._gap),
field('value', choice($.read_cond_lit,
$.tagged_or_ctor_lit,
$.map_lit,
$.str_lit,
$.kwd_lit,
$.sym_lit))), With that change, using ahlinc's alpha, I get:
So far that looks ok to me. |
Now it should be possible to test things out by using the If you have an appropriate version of babashka, it should be possible to use babashka tasks for fetching and testing. One task will fetch ClojureDart code from some repositories and the other will run the To see a list of tasks try Lines 5 to 6 in 0f4e064
Invocations are The corresponding tasks are defined in files that live here. On a side note, there is also bash completion stuff here. I went for putting a [1] Note: I force-pushed after the initial posting so the commit mentioned before (0f4e064) is not valid any more. |
The change is just allowing metadata to be defined with That syntax is so strange I can't begin to understand why it is necessary in clojure dart. I will try to pull down and test later, maybe tomorrow? We will see and I will report back as soon as I have the chance. |
Regarding necessity, I found the following text:
via: https://github.com/Tensegritics/ClojureDart/blob/main/doc/differences.md#generics So may be that's saying:
is an abbreviation for:
|
I understand, thanks for explaining. Seems like CLR clojure does something different as well (CLR also has real runtime generics) as per our discussion on
If only we had a specification for this language. At least this fix seems a little more straight forward than that of the CLR types. FWIW I tried it yesterday and it worked fine with my simple tests, I just forgot to report back. |
As we are splitting off some of the dev-related bits into another repository and some of those bits were on the dev branch, I've made a separate pre-0.0.12 branch to preserve the bits that are remaining here. The fix can now be seen at 7df2726. Added a test at 7de8f06. |
As mentioned above, addressed in 7df2726. |
As discovered here, it appears our grammar (421546c) doesn't handle a construct which seems to be used by ClojureDart folks.
I've only managed to find a bit under 150
.cljd
files so far, but I found 8 files where a certain construct isn't handled (and the construct appears more than once in multiple files).To repeat a bit here (new info follows the quote)...
Begin Quote
I found something our grammar doesn't seem to handle:
Assuming for the moment that that is valid, I presume the
^
indicates metadata. IIUC,#/(w/State ~fx-class #_m/SnackBar)
is a tagged literal. So there is some metadata which is on(...)
(the...
is meant to stand in for more code here).I guess that's not a case I anticipated:
tree-sitter-clojure/grammar.js
Lines 335 to 342 in 421546c
If we're lucky a fix might be a matter of attending to that last
choice
there somehow.Adding something in the last
choice
there (and I guess may be inold_meta_lit
) is one option.This brings up the topic of whether that
choice
should be there restricting things...possibly it could be replaced with$._form
.End Quote
I've tried both of the approaches mentioned above and they seem to work (though it may be that one is a bit slower than the other -- not sure yet). I think they do ok on our clojars tests as well but I'll check that again after some sleep perhaps.
Below are sort of the raw error results that turned up:
The text was updated successfully, but these errors were encountered: