A parser for the Power Query / M formula language, written in TypeScript
Перейти к файлу
Matt Masson a31c8c9057
npm audit fix (#387)
Co-authored-by: Matt Masson <mmasson@microsoft.com>
2024-09-19 17:22:45 -04:00
.github Add pr-gated.yml (#381) 2024-03-27 17:31:41 -05:00
.pipelines enough tinkering 2022-06-09 13:42:26 -05:00
.vscode npm audit fix (#387) 2024-09-19 17:22:45 -04:00
src Fix StringUtils.ensureQuoted to escape multiple quotations (#382) 2024-04-05 11:16:17 -05:00
.eslintignore Migrate to eslint (#284) 2021-12-29 08:36:06 -08:00
.eslintrc.js Make Traverse API async (#295) 2022-03-02 08:30:30 -06:00
.gitignore Update benchmark test (#357) 2023-03-01 14:59:00 -06:00
.prettierrc Update prettier (#125) 2020-04-08 10:00:49 -07:00
LICENSE Initial commit 2019-03-25 13:44:13 -07:00
NOTICE.txt use component governance generated notice file (#146) 2020-04-28 15:44:31 -04:00
README.md add reference to the sdk 2022-09-29 08:38:40 -05:00
SECURITY.md Microsoft mandatory file (#309) 2022-05-19 10:00:29 -05:00
package-lock.json npm audit fix (#387) 2024-09-19 17:22:45 -04:00
package.json Fix StringUtils.ensureQuoted to escape multiple quotations (#382) 2024-04-05 11:16:17 -05:00
specification.md removed some outdated differences between parser and spec 2023-05-01 10:07:44 -05:00
style.md Update code style (#341) 2022-09-02 10:47:15 -05:00
tsconfig.json Replace `const enum` with `enum` (#380) 2024-03-27 20:22:43 -05:00

README.md

powerquery-parser

Build Status

A parser for the Power Query/M language, written in TypeScript. Designed to be consumed by other projects.

How to use

The most common way to consume the project is to interact with the helper functions found in taskUtils.ts. There are all-in-one functions, such as tryLexParse, which does a full pass on a given document. There are also incremental functions, such as tryLex and tryParse, which perform one step at a time. Minimal code samples can be found in example.ts.

Things to note

Parser

The parser started off as a naive recursive descent parser with limited backtracking. It mostly followed the official specification released in October 2016. Deviations from the specification should be marked down in specification.md. A combinatorial parser has since been added which uses the naive parser as its base.

Style

This project uses prettier as the primary source of style enforcement. Additional style requirements are located in style.md.

How to build

  • Install NodeJS
  • npm install
  • npm run-script build

How to run tests

  • Install NodeJS
  • npm install
  • npm test

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.