guybedford / es-module-lexer

Low-overhead lexer dedicated to ES module parsing for fast analysis
MIT License
930 stars 48 forks source link

Error lexing export with comment between variable names and equal sign #39

Closed LarsDenBakker closed 4 years ago

LarsDenBakker commented 4 years ago

graphql generates code like this: https://unpkg.com/browse/graphql@14.5.8/type/definition.mjs#LC752 which throws an error in the lexer.

It looks like it's the comment between the variable name and the equals sign that's causing the issue.

This throws as well:

export var GraphQLEnumType /* <T> */ = /*#__PURE__*/ function () {

and

export var GraphQLEnumType /* <T> */ = function () {
guybedford commented 4 years ago

@LarsDenBakker did you try this with the very latest release of es-module-lexer (0.3.13)? I just tested it out on this version and it seems to work ok there.

LarsDenBakker commented 4 years ago

Looks like we were still on an older version, sorry about that!