tunnelvisionlabs / antlr4ts

Optimized TypeScript target for ANTLR 4
Other
624 stars 106 forks source link

Eliminate overloads of CharStreams.fromString() #457

Open BurtHarris opened 4 years ago

BurtHarris commented 4 years ago

The typescript handbooks says: Don’t write several overloads that differ only in trailing parameters.

added test case for source name

BurtHarris commented 4 years ago

@sharwell, this 4.7 change around factory methods on class CharStreams is cool. With that interface, I'm pretty sure we can implement CharStreams.fromFileName(), at least on node.js, because one of the few synchronous I/O operation supported is reading a whole file.

I'll see how that goes, and add it to this PR if appropriate.

BurtHarris commented 4 years ago

@sharwell that was weird, the appveyor job ran tslint, and barfed on my lack of trailing commas is lists.

When I ran npm install, it didn't catch the commas. Seems like if we run tslint on appveyer, we should run it before commits too.

BurtHarris commented 4 years ago

Related #163, this really calls for a full codebase review.