hegemonic / catharsis

A JavaScript parser for Google Closure Compiler and JSDoc type expressions.
MIT License
54 stars 14 forks source link

Intersection type parse error #62

Open JackJek opened 4 years ago

JackJek commented 4 years ago

https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html

simonseyock commented 3 years ago

I am working on typings for the mapping library openlayers ( https://github.com/openlayers/openlayers ) and especially generating typescript typings out of jsdoc. We had a problem that I was able to solve with the mentioned intersection types ( https://github.com/openlayers/openlayers/issues/11960 ). Sadly they cause parsing errors.

As typescript typing generation and typescript typechecking is something that will probably become even more relevant I think it would be nice to bring more of this into here.

I'd love to look into this issue and create a PR for this as I already have some experience with PEG.js if this is desired.

Another thing I might want to look into at some point is the inline import syntax of typescript. (i.e. * @property {import("./file.js").Type} prop ) as this is also used in openlayers, but is solved with complex rewrite rules. This would be for another time though.