GithubHelp home page GithubHelp logo

jimidle / antlr-format Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mike-lischke/antlr-format

0.0 0.0 0.0 1.26 MB

A tool to format ANTLR grammars

License: MIT License

JavaScript 0.17% TypeScript 4.79% ANTLR 95.04%

antlr-format's Introduction

Weekly Downloads npm version

antlr-format

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 - 2.1.5

  • 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.

antlr-format's People

Contributors

mike-lischke avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.