elm-typescript-interop icon indicating copy to clipboard operation
elm-typescript-interop copied to clipboard

Explore using stil4m/elm-syntax instead of elm-ast

Open dillonkearns opened this issue 6 years ago • 3 comments

Using https://github.com/stil4m/elm-syntax may potentially address a few problems:

  • The elm-ast libraries have several parsing bugs
  • The elm-ast libraries are not planning on upgrading to Elm 0.19
  • Using elm-syntax may also help with only parsing modules which are imported somewhere

Here's the original comment suggesting this library: https://github.com/dillonkearns/elm-typescript-interop/issues/15#issuecomment-438448890

Here are some current issues in elm-typescript-interop it could address:

  • Performance for large projects https://github.com/dillonkearns/elm-typescript-interop/issues/16
  • Ignore unimported modules https://github.com/dillonkearns/elm-typescript-interop/issues/11
  • Parsing bugs like https://github.com/dillonkearns/elm-typescript-interop/issues/15 and several others

dillonkearns avatar Dec 15 '18 21:12 dillonkearns

If #18 is merged, then FYI it will have to be updated if we move away from elm-ast.

davetapley avatar Jan 12 '19 20:01 davetapley

I'm throwing in a wild idea: How about some manual pre-processing of the modules? In particular, stripping -- comments to alleviate the problems experienced in #15.

Also note https://github.com/andre-dietrich/parser-combinators

muelli avatar Oct 21 '19 10:10 muelli

I suggested the manual preprocessing in a github issue a while back for the Bogdanp parsing library, but it seems like that one isn't being actively maintained lately (at least the last I checked).

I think the still4m package is the way to go. It will take some time to change things over, though and I don't have much bandwidth at the moment, but I'll go that route when I do it.

dillonkearns avatar Nov 09 '19 20:11 dillonkearns