Closed l0rinc closed 7 years ago
That's great. You can have a look at org.elmlang.intellijplugin.manualParsing.CaseOfParser
class. let ... in
clauses need to be parsed by hand-written Java code, because it is one of 2 things that make Elm's grammar not context-free.
BNF can only express context-free grammars.
Thanks, will do that. However, currently the generated PSI seems invalid for some reason, e.g.
public interface ElmRecord extends PsiElement
doesn't contain getReferencesStream
:
Error:(45, 33) java: cannot find symbol symbol: method getReferencesStream() location: variable record of type org.elmlang.intellijplugin.psi.ElmRecord
Should it be a ElmPsiElement
instead?
Would it be a good idea to push the default generated files up also, to simplify this procedure? Or to create a simple Gradle
script that runs the code generation and tests automatically via Travis
?
Please try to generate the PSI once again. It sometimes generates incorrect code for the first run.
Regarding Gradle: there were some attempts to do it but it wasn't perfect: https://github.com/durkiewicz/elm-plugin/pull/7
I don't have enough Java ecosystem competences to do it properly. But if you are able to do it so that it:
then you are more than welcome to contribute.
Thank you @durkiewicz, generating it twice (without deleting the gen
) solved the issue. I've put that in the readme also.
I've provided a PR to fix this issue, though I couldn't find any let-in
tests to modify or run.
If you could give me some guidance, I would gladly augment the PR with proper tests also :).
For the following valid code
I get the error at the
c = 1
line:The workaround is simple:
I would gladly provide a PR for it, if needed :)