Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

pegjs-override-action

Package Overview
Dependencies
0
Maintainers
1
Versions
25
Issues
File Explorer

Advanced tools

pegjs-override-action

Override action (PEGjs plugin)

    0.0.2unpublished

Version published
Maintainers
1
Yearly downloads
1

Weekly downloads

Readme

Source

pegjs-override-action

Override action (PEGjs plugin)

Reason

This plugin came to life, as part of a process of referencing basic PEGs and build structure outside of the PEGs. In essence, it gives the possibility for reusable PEGs.

E.g. A collection of core PEGjs grammars (RFC, ISO, etc.)

Usage

npm install pegjs-override-action peg = require 'peg' overrideAction = require 'pegjs-override-action' parser = PEG.buildParser "start = 'a' / 'b' / 'c' / 'd' { return 'd' }", plugins: [overrideAction] overrideActionPlugin: rules: start: [ () -> "b" "return 'a';" undefined '__skip__' # equivalent to undefined atm ] parser.parse 'a' # 'b' parser.parse 'a' # 'b' parser.parse 'c' # 'c' parser.parse 'd' # 'd'

License

MIT

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc