New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-nearley

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-nearley

Wrapper around nearley js to allow for language creation / parsing in ember js

  • 2.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Ember Observer Score Build Status Coverage Status NPM Version NPM Downloads Dependency Status DevDependency Status Greenkeeper

ember-cli-nearley

Simple Wrapper around Nearley. This provides a service that can be used to parse source code and also automatically compiles the index.ne file in app/grammar/

DEMO

Installation

ember install ember-cli-nearley

Usage

import Route from '@ember/routing/route';

import { inject } from '@ember/service';

export default Route.extend({
	nearley: inject(),

	actions: {
		onClick() {
			let value = this.controller.get('value');
			this.get('nearley').parse(value);
		}
	}
});

OR

<div>
	{{#nearley-parse
		value=(concat input1 operator input2)
	as |computed|}}
		Result: {{computed}}
	{{/nearley-parse}}
</div>
  • Note this also includes Moo for tokenizing if needed
  • To use tokens from a different file file must be called tokens.js within app/grammar directory
  • and in your index.ne you must do this below. grammar-tokens is a shim created to allow you to import into your grammar.js file created from index.ne
@{%
	let moo = require('moo').default;

	let tokens = require('grammar-tokens').default;

	let lexer = moo.compile(tokens);
%}
# Pass your lexer object using the @lexer option:
@lexer lexer

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 17 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc