0.1.12 • Published 3 years ago
gmail-lang v0.1.12
Gmail query language
This Project only provides
- The LR Lezer grammar for the Gmail query language
- The code mirror language extension
- An AST query transformer to an intermedia representation
- A query interpreter to evaluate mail queries from the intermedia representation
Getting started
Install the npm package
npm i gmail-lang
yarn add gmail-langImport the gmail language from your code and use it.
import { Gmail } from 'gmail-lang'The package also exports:
Gmailwhich is the code mirror language extensionparserwhich is the Lezer Gmail parser to create a Lezer tree from the source codemakeQuery, is a function which receives the code mirror state, a tree and returns the respective querysourceToQueryis a function which receives the source code and returns the corresponding Gmail queryevalQueryis a function which receives a query, a data source and evaluates the query returning the result of evaluating the query.evalLangQueryis a function which receives a source and a data source and evaluates the query returning the result of evaluating the query.
The data source must respect the next interface:
filterByMatchallByKeywordintersectionuniondifference