Socket
Socket
Sign inDemoInstall

lezer-feel

Package Overview
Dependencies
Maintainers
0
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lezer-feel

Lezer-based FEEL grammar


Version published
Maintainers
0
Created
Source

lezer-feel

CI

This is a DMN FEEL grammar for the Lezer parser system.

Usage

Parse FEEL to a Tree:

import {
  parser
} from 'lezer-feel';

// parse <Expression>
parser.parse('foo > 1');
Choose Dialect

Use Expression or UnaryTests as a top node depending on which FEEL dialect you intend to parse:

import {
  parser
} from 'lezer-feel';

const unaryParser = parser.configure({
  top: 'UnaryTests'
})

// parse <UnaryTests>
unaryParser.parse('> 100');
Provide Context

Override the default context tracker to enable context sensitive parsing based on inputs:

import {
  parser,
  trackVariables
} from 'lezer-feel';

const contextTracker = trackVariables({
  'if foo then bar': 1
});

const contextualParser = parser.configure({
  contextTracker
});

// recognizes <if foo then bar> as a <VariableName>
contextualParser.parse('if foo then bar');

Development

# build and test
npm run all

# test
npm test

# test (debug)
LOG=fparse:dbg,fparse,context,parse npm test

Prefix individual tests with a * to test them in focus mode:

# *ArithmeticExpression (error)

...
  • feelin - Interpreter for the FEEL language
  • feel-playground - A visual playground to learn the FEEL language

License

The code is licensed under an MIT license.

FAQs

Package last updated on 21 Aug 2024

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