Closed gavinking closed 11 years ago
Actually the solution is pretty straightforward. All we need to do is move ANTLR into the repo and out of lib. Then everything works fine.
Were you able to make it work?
Yes, I was, all documented in ceylon/ceylon-ide-eclipse#385.
@gavinking I see that in the issue you link to you added org.antlr.runtime
to the repository while in the lib
folder we have antlr-3.4-complete.jar
which contains much more than the runtime (it's actually 3-4 JARs that have been put together in one). Do you know if using the antlr runtime would be enough for the compiler?
I just renamed antlr-3.4-complete.jar
to org.antlr.runtime
using the Export Java Archive wizard in the IDE. It's the same jar.
Ok @gavinking , this now works. I actually tested this with the real antlr-runtime
and it works perfectly (I'm guessing antlr-complete
is only needed for building ceylon-spec
) so I added that as a module, which saves us over 2MB on the distribution size (yay!).
You'll need to update ceylon-dist
and then do the normal ant update-all clean publish-all
jig.
Why is the new module called org.antlr-runtime
instead of org.antlr.runtime
(notice the hyphen)? That's not a valid identifier...
I wondered this too.
It's because the makers of antlr themselves call it that way for Maven and I just copied that name. But today for ceylon/ceylon-dist#32 I made some other decisions because sometimes the Maven name is so different form what we would use. So I'm not sure what the best way is.
Btw, it's perfectly legal for imports to have hyphens, just enclose the name in quotes.
Btw, it's perfectly legal for imports to have hyphens, just enclose the name in quotes.
Alright, that works. FTR, they have to be single quotes; import "org.antlr-runtime" "3.4"
gives me this error:
cannot find module source artifact "org.antlr-runtime"-3.4(.src|.car|.jar)
- dependency tree: source_gen.ceylon.formatter/1.0.0 -> ceylon.formatter/1.0.0 -> "org.antlr-runtime"/3.4
-- it appears that whatever transforms the module name+version into a file name only strips single quotes from the module name.
FTR, they have to be single quotes
Ooops, thanks, I have fixed this bug in the typechecker and added a test.
On Thu, Oct 17, 2013 at 11:16 AM, Lucas Werkmeister < notifications@github.com> wrote:
Btw, it's perfectly legal for imports to have hyphens, just enclose the name in quotes.
Alright, that works. FTR, they have to be single quotes; import "org.antlr-runtime" "3.4" gives me this error:
cannot find module source artifact "org.antlr-runtime"-3.4(.src|.car|.jar)
- dependency tree: source_gen.ceylon.formatter/1.0.0 -> ceylon.formatter/1.0.0 -> "org.antlr-runtime"/3.4
- it appears that whatever transforms the module name+version into a file name only strips single quotes from the module name.
— Reply to this email directly or view it on GitHubhttps://github.com/ceylon/ceylon-runtime/issues/47#issuecomment-26489552 .
Gavin King gavin@ceylon-lang.org http://profiles.google.com/gavin.king http://ceylon-lang.org http://hibernate.org http://seamframework.org
I could have sworn I had opened an issue for this! But I can't find it anymore so I must have been dreaming.
Btw, shall we get rid of the single quotes? I see all kinds of places that mix them, some use single quotes, others use double quotes. In the rest of the language single quotes are only used for characters so it's not really consistent, right? I'll do the search and replace if you want :)
Btw, shall we get rid of the single quotes?
They are not an official part of the language, they are left in only for backward compatibility.
Sure, but that's something we can easily fix now we're still pre-1.0, right? Right now we break things all the time :)
It sounds to me like now would be the best time to get rid of them.
I mean, it's a just a totally trivial change to the grammar.
So why not do it? Wouldn't it make the language a tiny bit more regular that way? (sequences or characters use ", single characters use ' )
here's the relevant part of the grammar. It actually appears that we allow single quotes for the version number as well.
Wouldn't it make the language a tiny bit more regular that way?
Which part of "not an official part of the language" did you not understand? :)
Sure, but most people are not going to read the spec, trust me ;)
So they'll just look at examples, copy some code and because some of it contains single quotes they'll start doing so as well.Hey the compiler accepts it, so why not? And before you know it you can't change it anymore because it would break a lot of code (and for what?)
So in @bb97c56 I have changed the typechecker to produce a meaningful error in this case. This will most likely break a bunch of tests in other subprojects, so it is now @quintesse's punishment to go and search for and fix any breakage.
Hahaha! Oh the joy! ;)
Here's a GitHub search that finds loads of these module descriptors.
The SDK uses single-quoted versions all over the place.
You might be able to use the new ceylon version
tool to do this really easily.
Done. Luckily almost no documentation used single quotes in the text so I could mostly just do:
find . -name module.ceylon -exec sed -i -e s/\'/\"/g {} \;
In this issue we came across the fact that it is basically impossible to write a Ceylon module that reuses the typechecker. The problem is likely somehow connected to dependencies in the
lib/
dir, but JBoss Modules is not producing very helpful error messages, and so I was not able to arrive at a better understanding of what was going on.The Ceylon code I want to make work is: