A parser for the Power Query / M formula language, written in TypeScript
Перейти к файлу
JordanBoltonMN 79dec1c2e1
Several API updates (#356)
* updated version number

* alpha sort, added unboxOrDefault

* removed dead code

* PartialResult -> PotentiallyIncompleteResult

* back to partialResult

* moving settings around

* moving settings around v2

* final changes to settings

* alpha sort imports

* added ExpiredCancellationToken, writing cancellation propagation logic

* renaming all `catch (x)` to `catch (caught)`, boxOk -> ok

* initial commit
2023-02-27 10:18:14 -06:00
.github/ISSUE_TEMPLATE Update issue templates (#147) 2020-04-29 17:02:17 -07:00
.pipelines enough tinkering 2022-06-09 13:42:26 -05:00
.vscode add formatOnSave 2022-01-04 08:17:45 -08:00
scripts Fix trailing decimals as invalid identifiers (#300) 2022-03-29 08:59:58 -05:00
src Several API updates (#356) 2023-02-27 10:18:14 -06: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 Custom parsers + benchmark existing parsers (#107) 2020-02-21 09:58:59 -08: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 Several API updates (#356) 2023-02-27 10:18:14 -06:00
package.json Several API updates (#356) 2023-02-27 10:18:14 -06:00
specification.md Removing deviation note, as grammar has been updated (#353) 2023-02-22 14:32:59 -06:00
style.md Update code style (#341) 2022-09-02 10:47:15 -05:00
tsconfig.json added preserveConstEnums 2022-12-07 11:21:20 -06: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.