1.2.8 • Published 2 months ago

lezer-feel v1.2.8

Weekly downloads
52
License
MIT
Repository
github
Last release
2 months ago

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)

...

Related

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

1.2.8

2 months ago

1.2.7

2 months ago

1.2.6

3 months ago

1.2.5

3 months ago

1.2.4

5 months ago

1.2.3

5 months ago

1.2.2

5 months ago

1.2.1

5 months ago

1.2.0

7 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.17.0

1 year ago

0.17.1

1 year ago

0.16.1

1 year ago

0.16.2

1 year ago

0.15.0

1 year ago

0.16.0

1 year ago

0.11.0

2 years ago

0.12.0

2 years ago

0.11.1

2 years ago

0.13.0

2 years ago

0.12.1

2 years ago

0.11.2

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.11.3

2 years ago

0.14.1

2 years ago

0.11.4

2 years ago

0.10.0

2 years ago

0.8.9

2 years ago

0.8.8

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.9.1

2 years ago

0.8.2

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago