Skip to content

Conversation

maxence-lefebvre
Copy link
Contributor

Hi,

As of today, InputStream is the default export of its module and not a named one.

image

The module CharStreams was trying to load the named one which does not exist.

Test case

console.log(require('antlr4').CharStreams.fromString('test'))

Expected

InputStream {
  name: '<empty>',
  strdata: 'test',
  decodeToUnicodeCodePoints: true,
  _index: 0,
  data: [ 116, 101, 115, 116 ],
  _size: 4
}

Actual

TypeError: InputStream is not a constructor
    at Object.fromString (node_modules\antlr4\src\antlr4\CharStreams.js:19:12)

@ericvergnaud
Copy link
Contributor

Would you mind adding a test? It's a pity we didn't have one to detect that break...

@ericvergnaud ericvergnaud merged commit 1b947ee into antlr:master Dec 6, 2020
@ericvergnaud
Copy link
Contributor

Thanks!

@parrt parrt added this to the 4.9.1 milestone Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants