npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

antlr-format

v2.1.5

Published

A formatter lib for ANTLR4 grammars

Downloads

60

Readme

Weekly Downloads npm version

The antlr-format package provides a small library to format your ANTLR4 grammar in a wide variety of ways. It has a companion named antlr-format-cli which provides a terminal command for running the formatter in batch files and so on. You can read more about it in its own Readme.

Installation

Nothing special here, just use NPM (or any other package manager):

npm i antlr-format

Usage

Read the formatter documentation for further details and a code example.

Release Notes

2.1.4

  • Updated dependencies.

2.1.3

  • Stop including 3rd party libs in bundle.
  • Updated dependencies.

2.1.2

Updated dependencies

2.1.1

Fixed bug #2 antlr-format produces output that isn't a fixed point, removes comments

2.1.0

Made useTab false by default. No idea why I made this true by default. I hate tabs in source files.

2.0.3 - 2.0.4

  • Fixed bug where rule names after block comments where not placed on an own line;
  • Added support for colons in blocks, which are optional and may align with alts just like on rule level.
  • Added support for rule options, which are formatted like global options.
  • Fixed a bug where the formatter added formatting options, even if there were already some in the grammar.

2.0.2

Fixed a problem related to getting raw content for output in the formatter (e.g. action text). Also changed a number of imports/settings to fix a problem with debugging the formatter in VS Code.

2.0.1

Added missing type definition entry in package.json.

2.0.0

BREAKING CHANGE:

The package has been split into a cli wrapper and the actual formatter class. This avoids inclusion of otherwise unnecessary packages, when importing this package and works around a problem with esbuild when mixing ESM and CommonJS modules running in Node.js (for example using Jest with ts-jest).

Additionally, the GrammarFormatter class now accepts a string with the grammar content and does the tokenization on its own. This avoids that you have to run the ANTLRv4 lexer manually (or even care for it at all).

1.0.0

This is the initial release of the package.